Start: Jan, 04, 2017 19:40:00
2016年秋季学期程序设计基础期末考试
End: Jan, 04, 2017 21:40:00
Time elapsed:
Time remaining:

Problem_ID: F
Result: Accepted
Time: 1ms
Memory: 1092kB
Author: 2016210402079
In contest: 1084

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