FERT21_0 - Matches

Upon a table there are two boxes. Each box has N matches inside. We want to know what is the probability of choose N times a random box and take one match from it, at the end have an empty box.

You have to print all digits.

Constraints
1 <= T <= 1000
1 <= N <= 1000

Input

T
N1
N2
...
NT

Output

P1
P2
...
PT

Example

Input:
1
2

Output:
0.5

Added by:leandro
Date:2010-03-03
Time limit:1s
Source limit:50000B
Memory limit:1536MB
Cluster: Cube (Intel G860)
Languages:All except: JS-RHINO OBJC SQLITE
Resource:own problem

hide comments
2012-08-29 16:00:47 Josef Ziegler
move to tutorial
2012-04-23 08:24:22 Gaurav Mittal
please give one more example
2011-09-05 00:32:59 Eternal Answer
What's the answer for N=10?
2011-05-14 11:21:33 cegprakash
enjoyed solving :)
2011-03-25 00:35:08 Chetan Gupta
what is SIGBUS..??
i am getting runtime error (SIGBUS)..
2011-02-23 17:46:55 Jay Pandya
my submission is too simple ... so why it is giving runtime error??? please explain me so in future i can keep it in mind...i am not divinding by 0 any where.... please help me... my submission ID is - 4725827... thanks in advance :)
2010-05-22 07:00:31 Vamsi Kavala
i submitted a python code several times only to get a TLE..then i submitted a c++ code which was slower than my python code on my system...it got AC...can sum1 explain y did tht happen?

Last edit: 2010-05-23 04:27:09
2010-05-21 11:11:41 sudipto das
the prog involves calculation of all digits after point & don't worry the answers are of finite lengths..........
2010-05-12 03:12:11 Ishan
what do you mean by "all digits."?
----6 digits after the decimal or until a recurring after the decimal occurs?please clarify..

Last edit: 2010-05-12 03:13:12
2010-04-19 11:22:04 biQar
"You have to print all digits."...what does it mean..???..please help me..!!!:(:(:(
© Spoj.com. All Rights Reserved. Spoj uses Sphere Engine™ © by Sphere Research Labs.