11291129 SUSTech Online Judge
Problem 1129 --High School Problem[Easy]

1129: High School Problem[Easy]

Time Limit: 1 Sec  Memory Limit: 128 MB
Submit: 1049  Solved: 271
[Submit][Status][Web Board]

Description

Joy is a twelfth grade student who is aiming to go to SUSTech. One day, when he is doing math practices. He found a problem very hard. It gives a function goes like F(x) = 5x7+6x6+3x3+4x2-2xy (0 <= x <=100), y is a given real number. Can you help Joy find the minimum value of F(x) when x is in its domain?

Input

The first line of the input contains an integer T (1 <= T <= 100)  which means the number of test cases. Then T lines follow, each line has only one real numbers Y (0 < Y < 1010).


Output

For each case, print the case number as well as the minimum value (accurate up to 4 decimal places) in one line, when x is in its domain.

Sample Input

3
100
200
300

Sample Output

Case 1: -193.3774
Case 2: -448.1475
Case 3: -729.3383

HINT

Source

 

[Submit][Status]