Maximum Length

4

1 votes
Problem

In this problem you will be given a half-circle. The half-circle’s radius is r. You can take any point A on the half-circle and draw 2 lines from the point to the two sides of the diameter(AB and AC). Let the sum of square of one line’s length and the other line’s length is s.

Alt Text
Like in the figure s = AB^2+AC; and BC = 2r.

Now given r you have to find the maximum value of s. That is you have to find point A such that AB^2+AC is maximum.

Input Format:

First line of the test case will be the number of test case T . Then T lines follows. On each line you will find a integer number r; each representing the radius of the half-circle.

Output Format: For each input line, print a line containing “Case I: ”, where I is the test case number and the maximum value of s. Print 2 digit after decimal

Note:

Errors should be less then .01.

Constraints:

1 <= T <= 1000

1 <= r <= 1000000

Sample Input
1
1
Sample Output
Case 1: 4.25
Time Limit: 1
Memory Limit: 256
Source Limit:
Contributers:
Editor Image

?