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: 3ms
Memory: 1120kB
Author: CT12810101281
In contest: 1281

#include<stdio.h>
int main(){
    int t,n,m;
    scanf("%d",&t);
    while(t--){
    	scanf("%d",&n);
    	if(n%3==0)
    		m=(n*2/3)%3;
		else if(n%3==1)
			m=(2*(n/3)+1)%3;
		else
		m=(((n-2)/3+1)*2)%3;
    	printf("%d\n",m);
	}
	return 0;
}