The Strange Assignment
Easy Accuracy: 13.99% Submissions: 307 Points: 2

Ishaan's teacher gave him an assignment. Given a number N, he need to find out the Nth term of a strange series.Ishaan is not able to solve this assignment, help him find the term.
Refer Example for series.

Input : 
First line of input contains a single integer T denoting the number of test cases.The only line of each test case contains an integer N.

Output : 
For each test case, print the required answer in a new line.

Constraints : 
1 <= T <= 200
1 <= N <= 1012

Example : 
Input : 

10
1
2
3
4
Output : 
0
1
1
1

 

to report an issue on this page.

Editorial

We strongly recommend solving this problem on your own before viewing its editorial. Do you still want to view the editorial?

Yes

All Submissions

My Submissions:

Login to access your submissions.