3046: Happy Running

时间限制:1000 ms 内存限制:128 MB
上传者:
提交:2 通过:2

题目描述

$Happy \ Running$, an application for runners, is very popular in $CHD$.

In order to lose weight, $fdf$ decides to run $k$ meters per day with $Happy \ Running$. Let's regard the school as a circular runway with total length of $x$ meters, and $fdf$ could start running clockwise at a random point on the runway. Then $Happy \ Running$ will randomly show two punching-card points (打卡点). Because of the poor physical strength, $fdf$ decides to finish running only by completing the punch, whether or not complete the goal of $k$ meters.

One day, before running, $fdf$ wants to know whether he can achieve the goal today, and he asks you to help him to calculate the probability of completing the goal running $k$ meters.

Note that, $fdf$ should punch card one by one which means that he will punch card at the first point before the second, even if he reaches the second point first.

It is guaranteed that punching-card points and the point $fdf$ starts running will appears randomly with equal probability and the three points won't be coincide.


输入格式

The first line contains an integer number $T$, the number of test cases.

$i^{th}$ of each next $T$ lines contains two integer numbers $k, x(1 \leq k, x \leq 10^9)$.

输出格式

For each test case print the probability of completing the goal, round to two decimal places.

输入样例 复制

3
2 2
4 3
2 1

输出样例 复制

0.50
0.22
0.00