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: 2ms
Memory: 1092kB
Author: wyy1998
In contest: 1084

#include<stdio.h>
#include<math.h>
int main(void){
	int T,n;
	int x,y;
	int i,sum;
	scanf("%d",&T);
	while(T--){
		x=0;
		y=0;
		sum=0;
		scanf("%d",&n);
		for(i=0;i<=n/3;i++){
		if((n-3*i)%2!=0)
			sum+=0;
		else if((n-3*i)%2==0)
		sum+=1;
		}
		if(sum==0)
			printf("WA\n");
		else
		{
			for(i=0;i<=n/3;i++){
			if((n-3*i)%2==0){
				x=(n-3*i)/2;
			y=i;
		}
		}
		printf("%d %d\n",x,y);
	}
}	
}