SCUSA Region ICPC Masthead ACM Balloon Logo
2017 ACM ICPC South Central USA Regional Programming Contest

K - State Fair

"Kooky Kenny" (as the carnies call him) is setting up a park attraction at the state fair.

He has already set up the tent for the circus performance he wishes to put up. What he wants to know is how to construct the barrier around the tent.

He knows he wants an isoceles triangle, with the shorter side being the side where he'll set up the ticket booth. Therefore people will be deterred from going along the longer sides, since park patrons hate walking.

While he knows how long he wants to make the shorter side, he wants to use the minimum amount of tape to make the other edges.

Putting on a circus is a costly business! Expenses need to be minimized and profits need to be maximized! Therefore the shorter side will be just long enough to encompass the circus tent.

Being the park's problem solver, can you help figure out the other side lengths for Kenny? Assuming the tent is a perfect circle of course.


You will be given the number of test cases. 1 < tc ≤ 100

For each test case you will be given the radius of the circus tent r and the length of the shortest side c of the attraction. The radius will be bounded by c, 1 ≤ r < c/2 ≤ 100. Note: r and c are both integers.


Your program should echo out the minimum length of the other side that still encompasses the circus tent and satisfies the triangle. Round your answer to 3 digits. Separate separate cases with a new line.

Sample Input

2 5
1 5

Sample Output