[BOJ 11337] Largest inscribed rectangle

View as PDF

Submit solution

Points: 1
Time limit: 2.0s
Memory limit: 256M

Problem types
Allowed languages
Assembly, Awk, C, C++, Java, Pascal, Perl, Python, Sed, Text

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.

입력 형식

First line of the input contains an integer T (1 <= T <= 1000) - the number of test cases. Next T lines each contain two integers R and B (1 <= R,B <= 10000).

출력 형식

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).

예제 입력

3
1 1
1 2
2 2

예제 출력

1.732
2.000
6.928

Comments

There are no comments at the moment.