← Back to Problems
The Rebalancing Fee
Easy standard Calculus & Analysis
Time limit: 1 s per test  ·  Memory: 256 MB

An account earns an annual rate r, compounded n times per year. Each compounding event also incurs a tiny rebalancing friction, so one dollar grows by the factor

1 + r/n - c/n^2

per period, where c > 0 is a fee parameter. As the rebalancing frequency n grows, the account approaches its continuous limit. Compute the value of one dollar after t years in that limit:

L = lim (1 + r/n - c/n^2)^(n t)   as n -> infinity

Input

Three numbers r, c and t, each given with at most 6 digits after the decimal point.

Output

Output L with absolute or relative error at most 1e-9.

Constraints

0.001 <= r <= 10

0 <= c <= 1000

0.01 <= t <= 20

r * t <= 50

Scoring

This is a standard problem: a submission scores full points if it produces the correct output for every test case, and zero otherwise.

Numeric answers are accepted if they are within an absolute tolerance of 1e-09 or a relative tolerance of 1e-09 of the expected value.

Examples

input
0.05 1 1
output
1.051271096376024e+0
input
0.1 0 2
output
1.221402758160170e+0
Python 3.13 i Execution environment Isolated microVM · 1 vCPU · no internet access Time and memory limits are set per problem Available packages numpy 2.5.0scipy 1.18.0pandas 3.0.0scikit-learn 1.9.0statsmodels 0.15.0cvxpy 1.9.2