Practice on Toph

Participate in exhilarating programming contests, solve unique algorithm and data structure challenges and be a part of an awesome community.

Compute the Combination

By Alim14 · Limits 2s, 512 MB

Let P = C(N,0) - C(N,1) + C(N,2) - C(N,3) + ... + C(N,N); where C(n,r) is "n choose r".

You are given N. You have to find the value of P.

Input

Input starts with an integer T (1 <= T <= 1000000), denoting the number of test cases. Each test case contains an integer N (0 <= N <= 1000000).

Output

For each test case, print the value of P.

Sample

InputOutput
1
4
0

This problem was authored for CodeMask Championship 2016 and is being hosted on Toph per organizer’s request.

Discussion

Statistics


80% Solution Ratio

rayhan50001Earliest, May '16

prodip_bsmrstuFastest, 0.0s

SakibulMowlaLightest, 131 kB

aNkanpy.pritomShortest, 66B

Submit

Login to submit

Toph uses cookies. By continuing you agree to our Cookie Policy.