Limits 1s, 512 MB

Mr. X is course teacher of Numerical Analysis. Gentleman X has announced that if anyone can solve the following problem he/she does not need to participate in mid-term exam.

A function f is defined by:

$ f(x) + 3 f(\frac{1}{x}) = x^2 $

Now the problem is, what is the value of f(x) for any x. Are you interested in taking the challenge?

Input

Input starts with an integer T (0 < T ≤ 300), denoting the number of test cases. Each case starts with a line containing an integer x (-500 ≤ x ≤ 500).

Output

For every test case, print in a line the value of f(x) up to two decimal place after floating point. If answer does not exist print "Undefined" without quotes.

Sample

InputOutput
2
1
11
0.25
-15.12

Submit

Login to submit.

Statistics

89% Solution Ratio
kamran_11bEarliest, Jan '18
hamza05Fastest, 0.0s
steinumLightest, 5.5 kB
bokaifShortest, 106B
Toph uses cookies. By continuing you agree to our Cookie Policy.