National Olympiad in Informatics, China, 2001
The inverse tangent function can be expressed as an infinite series, as shown below:
It is commonly known that the inverse tangent function can be used to
compute
Of course, this method is rather inefficient. We can apply the tangent angle sum identity:
After some simple manipulation, the following is obtained:
Using this identity, let
Using the inverse tangents of
We take equation (4) and write it in the following form:
where
The problem is, for a given
Input Specification
The input consists of a single positive integer
Output Specification
The output should contain a single integer, the value of
Sample Input
1
Sample Output
5
Problem translated to English by .
Comments