CodeChef: May Long Challenge | Xor Equality | XOREQUAL | Solution

Codechef

View on Codechef

For a given NN, find the number of ways to choose an integer xx from the range [0,2N−1][0,2N−1] such that x⊕(x+1)=(x+2)⊕(x+3)x⊕(x+1)=(x+2)⊕(x+3), where ⊕⊕ denotes the bitwise XOR operator.

Since the number of valid xx can be large, output it modulo 109+7109+7.

Input

  • The first line contains an integer TT, the number of test cases. Then the test cases follow.
  • The only line of each test case contains a single integer NN.

Output

For each test case, output in a single line the answer to the problem modulo 109+7109+7.

Constraints

  • 1≤T≤1051≤T≤105
  • 1≤N≤1051≤N≤105

Subtasks

Subtask #1 (100 points): Original Constraints

Sample Input

2
1
2

Sample Output

1
2
Solution will be updated here soon. Keep tracking

See more posts here

Leave a Comment

Your email address will not be published. Required fields are marked *

x