Calculate The Sum If You Can

Rajib_119 Comilla University CSE Fi...
Limits 2s, 512 MB

This problem deals with the following expression:

12+12+12+12+12+12+12+... 1-2+1-2+1-2+1-2+1-2+1-2+1-2+...

Given n, you have to determine the sum of the expression up to the n'th term.

Input

The first line of input contains the number of test cases T (1 ≤ T ≤ 100000). The next T lines each contains an integer n (1 ≤ n ≤ 1012).

Output

For each case find the sum up to n'th term of the given series.

Sample

InputOutput
3
1
2
5
1
-1
-1

Submit

Login to submit.

Statistics

91% Solution Ratio
shahed95Earliest, Dec '17
mumith_fahim99Fastest, 0.0s
atiq_143Lightest, 1.2 MB
WasiMasterShortest, 56B
Toph uses cookies. By continuing you agree to our Cookie Policy.