Euler’s number (you may know it better as just ) has a special place in
mathematics. You may have encountered in calculus or economics (for
computing compound interest), or perhaps as the base of the
natural logarithm, , on your calculator.
While can be
calculated as a limit, there is a good approximation that can
be made using discrete mathematics. The formula for
is:
Note that . Now
as approaches
, the series
converges to . When
is any positive
constant, the formula serves as an approximation of the actual
value of . (For
example, at the
approximation is already accurate to decimals.)
You will be given a single input, a value of , and your job is to compute the
approximation of for
that value of .
Input
A single integer ,
ranging from to
.
Output
A single real number – the approximation of computed by the formula with the
given . All output must
be accurate to an absolute or relative error of at most
.
Sample Input 1 |
Sample Output 1 |
3
|
2.6666666666666665
|
Sample Input 2 |
Sample Output 2 |
15
|
2.718281828458995
|