#P1729. Computing the Fractional Digits of e
Computing the Fractional Digits of e
Computing the Fractional Digits of e
In this problem, you are given an integer n
(1 ≤ n ≤ 10000) and you must compute the first n
digits after the decimal point of Euler's number, ( e ).
Recall that ( e = \sum_{i=0}^{\infty}\frac{1}{i!} ). To achieve the required precision, you may need to use arbitrary precision arithmetic. The result should consist of exactly n
digits (pad with leading zeros if necessary) corresponding to the fractional part of ( e ); that is, if ( e = 2.d_1d_2d_3\ldots ) then you should output d1d2...dn
.
inputFormat
The input consists of one line containing a single integer n
(1 ≤ n ≤ 10000), which is the number of digits after the decimal point of ( e ) that you need to compute.
outputFormat
Output a string of exactly n
digits representing the digits after the decimal point in the value of ( e ).
sample
1
7