P16362 [HackerEarth] Statement :
普及-
题目描述

Statement :

Utkarsh and Debanjan are avid cricket and video game fans. They have recently purchased a new game , "Don Bradman Cricket 14". Debanjan challenges Utkarsh to play India vs Australia, and to defeat Australia in Legend Mode. Utkarsh has accepted the challenge and now faces a task to score "R" runs from "B" balls. Can you tell us the probability of Utkarsh winning the match if :

Every event is equiprobable.

The events are : {W,0,1,2,3,4,6}.

Note : Assume you have infinite wickets!

Input format:

First line contains T , the number of test cases. Each of the next T lines contains "R" , the number of runs required and "B" , the number of balls left.

Output format:

For every test case T , print the expected number of runs scored. Output should have exactly 6 decimal place precision.

Constraints:

1 ≤ T ≤ 10

1 ≤ R ≤ 1000

1 ≤ B ≤ 1000

SAMPLE INPUT
2
1 1
2 1

SAMPLE OUTPUT
0.714286
0.571429

Explanation

Case 1 : On the very first ball , he can score W , 0 , 1 , 2 , 3 , 4 , 6 with equal probability.

Case 2 : There are only 4 events that support a victory!

输入格式

见题面

输出格式

见题面

样例输入
10 1000 200 120 88 123 132 23 4 23 8 88 100 123 64 235 180 88 40 300 1
样例输出
0.003939 0.776637 0.945889 0.068472 0.479146 0.000200 0.290161 0.997788 0.014195 0.020408