Marble Madness#1202

Marble Madness

1 second
64 megabytes
Easy

Oyvind likes to test his future employees, especially with funny games. This time, he has invented a game where you start with black marbles and white marbles in a bag. There are also unlimited supplies of both types of marbles outside the bag. The game proceeds in rounds. In each round, you randomly take two marbles out of the bag and put one marble back in (possibly of a different color from the two taken out), following these rules:

  1. If you take out two white marbles, put a black marble back in.

  2. If you take out one black and one white marble, put a white marble back in.

  3. If you take out two black marbles, put a black marble back in.

At the end of the game, there will be only one marble left in the bag. You need to determine the probabilities that the last marble is black or white.

Input

The first line contains the number of test cases (0 < T \leq 100). Each test case is given on a single line with two integers and (0 \leq B, W \leq 50000, 0 < B + W), separated by a space, representing the number of black and white marbles, respectively.

Output

For each test case, output on a separate line two floating-point numbers separated by a space: the first is the probability that the last marble is black, and the second is the probability that it is white. Any answer within 10^{-6} of the correct answer will be accepted.

Examples

Example 1

Loading
Loading