In Calculus, the Leibniz formula for π is given by:
or:
You will be given an integer n. Your task is to print the summation of the Leibniz formula up to the nth term of the series correct to 15 decimal places.
Input Format
The first line contains the number of test cases (T) which is less than 100. Each additional line is a test case for a positive integer value (p) less than 10^7.
Sample Input
2
10
20
Output Format
Output T lines, with each line containing the summation up to nth term.
Sample Output
0.760459904732351
0.772905951666960
Scoring
This is a code golf question. The goal is to write a solution with as little code as possible. A correct submission with a source code of X characters will receive the following score:
maxScore * (300 - X)/300
Any correct code longer than 300 characters will receive a score of maxScore * 0.001.
MaxScore is the maximum score attainable for the problem.
Note that whitespace is also treated as a character.