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.
Constrains
1 <= T <= 1000
1 <= N <= 1000
Input
T
N1
N2
...
NT
Output
P1
P2
...
PT
Example
Input: 1
2
Output:
0.5
hide comments
mahilewets:
20170902 21:35:56
decimal. getcontext (). prec=1<<14


Krishna Mohan:
20150220 04:11:30
When the answer is 1 print "1".


Anubhav Gupta:
20150110 15:12:56
simple logic, but getting tle in java 

Shivam Dimri:
20131211 21:12:46
no matter how hard i try always getting tle!! even after optimizing the code, big integer handling and manipulation isn't possible in c++, had the code been written in java then maybe the problem would have been much simplified.. 

Aviral Jain:
20121224 05:07:33
can it have any ans different from 0.5???


Mahmoud Aladdin:
20120913 19:58:43
@numerix: printing that long string gives me a NZEC in my solution!! 

numerix:
20120912 21:28:23
@Mahmoud Aladdin: True. 

Mahmoud Aladdin:
20120912 16:58:11
@numerix: I used to output the exact value, where my answer got a NZEC. and IDEONE also NZEC for reaching the maximum output file size. So, don't know what exactly is wanted, as my answer for 1000 is 1001 characters long. Is that true?! or?! 

numerix:
20120907 17:07:06
@Mahmoud Aladdin: As it says in the description: "print all digits", i.e. the exact value. 

Mahmoud Aladdin:
20120907 13:53:27
Please clarify the format of the output! 
Added by:  leandro 
Date:  20100303 
Time limit:  1s 
Source limit:  50000B 
Memory limit:  1536MB 
Cluster:  Cube (Intel G860) 
Languages:  All except: JSRHINO OBJC SQLITE 
Resource:  own problem 