The Strange Assignment
Submissions: 294   Accuracy:

13.62%

  Difficulty: Easy   Marks: 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 <= 10^12

Example : 
Input : 

10
1
2
3
4
5
6
7
8
9
10
Output : 
0
1
1
1
1
2
1
1
1
2

 

** For More Input/Output Examples Use 'Expected Output' option **

Contributor: Anubhav Goyal
Author: goyalanubhav11


If you have purchased any course from GeeksforGeeks then please ask your doubt on course discussion forum. You will get quick replies from GFG Moderators there.



Need help with your code? Please use ide.geeksforgeeks.org, generate link and share the link here.


to report an issue on this page.