#B4083. Dirt Rate Calculation

    ID: 11740 Type: Default 1000ms 256MiB

Dirt Rate Calculation

Dirt Rate Calculation

In the XCPC contest, each team may submit several times for each problem. A submission for a problem is considered effective if and only if:

  1. The team has not solved the problem before this submission.
  2. This submission eventually leads to the team solving the problem.

For a given problem, suppose there are x effective submissions and among them y submissions were the ones that solved the problem. The dirt rate for the problem is defined as:

$$ \mathrm{dirt}(A)=\frac{x-y}{x} $$

You are given the effective submission data for n problems. For each problem, you will be provided two integers: x (the total number of effective submissions) and y (the number of effective submissions that eventually solved the problem). Your task is to compute the dirt rate for each problem.

Note: It is guaranteed that for each test case, x is positive.

inputFormat

The first line contains a single integer n (1 ≤ n ≤ 1000) representing the number of problems.

Each of the following n lines contains two integers x and y (1 ≤ y ≤ x ≤ 109) separated by a space, where x denotes the total number of effective submissions for the problem and y denotes the number of submissions that eventually solved the problem.

outputFormat

For each problem, output its dirt rate on a separate line. The answer for each problem should be a real number with exactly 6 digits after the decimal point.

sample

3
10 8
5 4
8 0
0.200000

0.200000 1.000000

</p>