IEEEBGAM  The Ball Game
Taru and Hanaku play a ball game. The game is played with N white balls, N black balls and N boxes. Hanaku chooses one box randomly and one ball from it randomly. Taru has to arrange the balls in such a way that the probability of Hanaku choosing a White ball is maximised. None of the boxes after the arrangement should be empty. Your task is to find that maximum probability.
Input
The first line contains the number of test cases (T) followed by T lines each an integer N.
Output
For each test case output the maximum probability of getting a white ball which is possible with an arrangement for the above configuration. Print the answer rounded to 8 decimal places.
Constraints
T <= 20
N <= 1000
Example
Sample Input: 1 1 Sample Output: 0.50000000
hide comments
pandey101299:
20190210 12:25:34
So easy problem Ac in one go.... Last edit: 20190210 12:26:04 

sanchit_aga:
20190108 17:55:46
Keep an eye on how you print your decimals, for example 0.66666667 will give AC while 0.66666666 will give WA if probability is 2/3. This cost me a WA. 

sanjay5797:
20170623 15:40:35
my 150th!!!...AC in one go....


iharsh234:
20151231 18:42:18
not classical one!


adi_tri:
20150813 21:31:58
should be move to where....yes...in tutorials... 

cosmopoliton:
20150320 06:38:31
dam easy once you get the right relation


Lehar:
20150221 11:32:11
AC after a month! :D 

Indian Cyber Army (IndiShell):
20150205 14:28:32
AC in 1st go .. :)


freaker:
20141220 07:37:07
1 line code in perl ... 

Aditya Joshi:
20141003 10:03:34
Be careful with the formatting of your answer. In Java use the DecimalFormat class to format your answer to 8 decimal places and remember to append a "0" to the start since DecimalFormat will return strings of the form .324 etc. 
Added by:  Saransh Bansal 
Date:  20120321 
Time limit:  0.100s 
Source limit:  50000B 
Memory limit:  1536MB 
Cluster:  Cube (Intel G860) 
Languages:  All except: ASM64 