#P10314. Mystical Function Evaluation

    ID: 12317 Type: Default 1000ms 256MiB

Mystical Function Evaluation

Mystical Function Evaluation

A curious function is defined as follows:

$$ f(x)=x-0.5+\frac{\arctan(\cot(\pi x))}{\pi} $$

Little A is fascinated by this function. You will be given T queries. For each query, you will receive a floating-point number x, and you must compute f(x) as defined above.

Your answer will be considered correct if its absolute or relative error does not exceed \(10^{-6}\).

inputFormat

The first line contains an integer T representing the number of queries. Each of the following T lines contains one floating-point number x.

outputFormat

For each query, output the value of f(x) in a separate line. The answer is accepted if it has an absolute or relative error of at most \(10^{-6}\).

sample

3
0.25
0.75
1.25
0.0000000000

0.0000000000 1.0000000000

</p>