Start: Jul, 05, 2019 08:40:00
2019年度暑期短学期达标测试
End: Jul, 05, 2019 11:40:00
Time elapsed:
Time remaining:

Problem_ID: I
Result: Accepted
Time: 6ms
Memory: 1768kB
Author: CT12812031281
In contest: 1281

#include<stdio.h>
#include<string.h>
#include<algorithm>
#include<iostream>
#include<stdlib.h>
#include<math.h>
#include<map>
#include<set>
#include<queue>
#include<vector>
using namespace std;
int T,t,x,y,z,m,n,k,f;
char s[10010];
//double p,q;
int main()
{
	cin>>t;
	while(t--){
		int ans=0;
		scanf("%d",&n);
		if(n%3==0) ans=(n/3)*2;
		else if(n%3==1) ans=(n/3)*2+1;
		else ans=(n/3)*2+2;
		printf("%d\n",ans%3);
	}
	
}