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 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).
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.
Input | Output |
---|---|
2 1 11 | 0.25 -15.12 |