1329 圆周率


Submit solution

Points: 100
Time limit: 1.0s
Memory limit: 32M

Problem types
Allowed languages
C, C++, Java, Python

Description

    祖冲之用了毕生精力算圆周率,也只算到小数点后第6位。现在有了电脑的帮忙,相信

我们就可以立刻就算出结果了吧,呵呵。

计算圆周率的方法很多,我们用其中的一个公式:

π/4=1-1/3+1/5-1/7+...+(-1)^(n+1)/(2*n+1) n=0,1,2,...

当n的取值越来越大时,π的精确度也就越高。

    现在给定n,计算相应的π值。

Input

输入数据中包含一些整数(0<n<400000),当n=0时,表示输入结束。

Output

每个整数对应一个计算结果,保留小数精度8位,每个结果独占一行。

Sample

Input

10
50
1000
0

Output

3.23231581
3.16119861
3.14259165

Comments

There are no comments at the moment.