SUMUP - Sum the Series

Nilendu is a brilliant student of Mathematics and always scores A+ in it. His professor RamjiLal is quite impressed seeing his mathematical skills and asks him to sum the following series:

1/3 + 2/21 + 3/91 + 4/273 + .....

But the fact is Nilendu is quite lazy to do his assignment. He has to watch a film and many other activities to do. So he asks you for your help. Will you be able to solve it ??

Input

Input consists of t (number of test cases), then t line follows, each containing an integer N (1 <= N <= 10,000).

Output

A single line containing the sum upto Nth integer (rounded upto 5 digits)

Example

Input:
5
1
2
3
4
5

 Output: 0.33333
0.42857
0.46154
0.47619
0.48387

Edit: The score is your source length. The smaller your code is, the more point you will get. All the solutions have been rejudged !!!

Added by:Better late than never !!!
Date:2012-06-20
Time limit:1s
Source limit:50000B
Memory limit:1536MB
Cluster: Cube (Intel G860)
Languages:All except: ASM64
Resource:RamjiLal Sir

hide comments
2013-05-25 06:57:34 Ankit Chaudhary
what is the answer for n=10000,n=5662 and n=5660
please tell me.... i m getting wrong answer.
thanks in advance...
2013-05-25 06:57:34 esprimo
how to round numbers (roundup or round off)? i get Wrong Answer but test cases are ok

Re -> In C use printf ("%.5lf", answer);

Last edit: 2012-08-15 19:25:14
2013-05-25 06:57:34 StupidGuy
Will resubmission to lower filesize will increase points?

RE -> Absolutely Yes..

Last edit: 2012-07-09 11:59:40
2013-05-25 06:57:34 Aradhya
nice question SNEHASISH :D
2013-05-25 06:57:34 Mitch Schwartz
@Ankit: Points calculation is described at bottom of rank page. For a challenge problem, suppose top score is T and your score is S. If S==T, you get 3 points. Otherwise, you get T/S points if the goal is to minimise score, or S/T if goal is to maximise.
2013-05-25 06:57:34 Ankit Paharia
My code is 182 bytes in C... how much points should i get ??? what is the maximum points to score in this questions ???
2013-05-25 06:57:34 data
@ambi use return 0 for NZEC error
2013-05-25 06:57:34 *__P__J__*
@snehasish : nice work........soldier....:P

Last edit: 2012-06-21 04:24:23
2013-05-25 06:57:34 Ranker
Nice question dude!!!


Last edit: 2012-07-06 14:44:00
© Spoj.com. All Rights Reserved. Spoj uses Sphere Engine™ © by Sphere Research Labs.