Vampire Dice

No attempts yetTime limit1sMemory limit256 MB

Problem

Vampire is a popular roleplaying game. Like most roleplaying games, Vampire uses dice to settle random events. The most common use of the dice is deciding whether you succeeded or failed at a task. A task might be shooting another player, staying inside a window instead of falling out of it, or dodging an opponent's hit.

The dice used in Vampire are 10-sided, and the rules are these. You may roll xx dice, and you need yy or more points to succeed. A die showing 8, 9 or 10 earns one point, so 1 through 7 earn nothing. On top of that, a 10 earns one extra roll. That is why two points or more are possible even when you start with a single die.

Here is an example. Truls tries to avoid falling into a trap. To succeed she has to score 4 or more points on 5 dice. Her first roll gives two 10s, a 4, a 6 and a 3. That is only two points, but the two 10s give her two more dice. This time she rolls a 10 and a 2. She now has three points and one more die. The last die lands on 5, and Truls falls into a big pit and dies.

How large was Truls' chance of surviving in the first place? Write a program that computes the probability of success from the number of dice and the point requirement.

Input

The first line contains the number of cases nn (1n1001 \le n \le 100).

Each of the next nn lines contains two integers xx and yy, where xx is the number of dice you start with (0x1000 \le x \le 100) and yy is the number of points needed to succeed (0y1000 \le y \le 100).

Output

For each case, print the probability of success on its own line, rounded to three decimal places and printed with exactly three digits after the decimal point.

No case has a probability that lands exactly on a rounding boundary, so there is no question of which way to break a tie.