Largest inscribed rectangle
Very easy
Execution time limit is 1 second
Runtime memory usage limit is 64 megabytes
Output the maximum area of a rectangle that can be inscribed into a circle of radius r. Rectangle's shorter side should not be longer than b.
Input
First line contains the number of test cases t (1 ≤ t ≤ 1000). Next t lines each contain two integers r and b (1 ≤ r, b ≤ 10000).
Output
For each test case print on a separate line the maximum area of a rectangle with a maximum shorter side b that can be inscribed into a circle of radius r. Your answer should be rounded to three digits after the decimal point (see sample output).
Examples
Input #1
Answer #1
Submissions 46
Acceptance rate 33%