beecrowd | 2148

Dice Seat

By Ricardo Martins, IFSULDEMINAS BR Brazil

Timelimit: 1

Every Sunday, a group of friends gathered in a park to talk. In addition, they played something called "dadinho", that in other regions is called "zezinho". Each player starts with one die and makes a guess. Then they throw the die, and if the guess is correct, they take a second die. Each round, the process repeats, and the player tries to guess the sum of the dice thrown. Whoever gets it right, would take another die. The game ends when a player makes a correct guess after having 13 dice. Consider that all dice used in the game are fair and have six faces, numbered from 1 to 6. As the amount of dice increases, it becomes more and more difficult to make a guess. Thus, they asked you to make a program which, given a guess, and an amount of dice, calculate the probability of getting the guess right.

Dice

Write a program that - given an integer, representing the guess, and another integer, the amount of dice to be played - calculates the probability that the guess is right.

Input

The first value is an integer C, indicating the number of test cases. Each test case consists of two integers S and D ( 1 ≤ S ≤ 80, 1 ≤ D ≤ 13 ), indicating the guess and the amount of dice.

Output

For each test case, print a line containing a value, double precision, with 15 decimal digits, informing the probability that the guess is right when that amount of dice is thrown.

Input Sample Output Sample

3

1 2

78 13

7 2

0.000000000000000

0.000000000076566

0.166666666666667