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

hide comments
Josef Ziegler: 2012-08-29 16:00:47

move to tutorial

Gaurav Mittal: 2012-04-23 08:24:22

please give one more example

Eternal Answer: 2011-09-05 00:32:59

What's the answer for N=10?

cegprakash: 2011-05-14 11:21:33

enjoyed solving :)

Chetan Gupta: 2011-03-25 00:35:08

what is SIGBUS..??
i am getting runtime error (SIGBUS)..

Jay Pandya: 2011-02-23 17:46:55

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 :)

Vamsi Kavala: 2010-05-22 07:00:31

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
sudipto das: 2010-05-21 11:11:41

the prog involves calculation of all digits after point & don't worry the answers are of finite lengths..........

Ishan: 2010-05-12 03:12:11

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
biQar: 2010-04-19 11:22:04

"You have to print all digits."...what does it mean..???..please help me..!!!:(:(:(


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