DCEPC12H  Height of Expectation
Welcome To ICPC! ICPC is a programming competition in which N teams participate every year. Out of N teams, K number of teams has been selected from our college. You know what? K is always a prime number. Coincidence! Before going to ICPC, we want to calculate our expected overall score of our college.
Expected Overall score is defined as expected median value of our college team’s ranks.
All the ranks are distinct. Team’s rank value always lies between 1 to N.
Input
First line consists of T, the number of test cases.
Each of the next T lines contains 2 space separated integers N and K.
Output
Output T lines each line containing expected overall score of our college. You should output at least 6 digits after decimal.
Constraints
1<=T<=500
1<=N<=100
1<=K<=10
N>=K
Example
Input: 1
3 3 Output:
2.0000000
hide comments
rv111:
20180711 19:47:19
wikipedia "expected median value".


madhur4127:
20170820 18:26:16
what a waste! 

manmeet_rana:
20170711 12:02:57
don't think too much(it costed me 1 wa )


vengatesh15:
20170208 06:19:41
Easy one :) 

dushyant_bgs:
20160624 15:30:00
Just google "Expected Median Value" and compare it with the mean. 

akshayjhamb2:
20160609 13:40:32
" Expected Median Value" someone please explain? 

akshayvenkat:
20160601 13:48:53
read up "average median value" and write the code :P 

vipul_vipul:
20160415 17:04:56
Maths ROXXXX.. 

Avi Aryan:
20150717 11:14:02
Easy pattern 

Mayank Agarwal:
20150617 14:45:52
what do we mean by Expected Median Value?? 
Added by:  dce coders 
Date:  20131207 
Time limit:  1s 
Source limit:  50000B 
Memory limit:  1536MB 
Cluster:  Cube (Intel G860) 
Languages:  C CSHARP C++ 4.3.2 CPP C99 HASK JAVA PASGPC PASFPC PYTHON PYTHON3 PY_NBC 