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: 2016210402034
In contest: 1084

#include<stdio.h>
#include<string.h>
#include<stdlib.h>
#include<math.h>


int main () {
	int t;
	int n,i;
	int a,b,flag;
	scanf("%d",&t);
	while(t--) {
		scanf("%d",&n);
		flag=1;
		for(i=0;i<=n;i+=2){
			if(n%3==0){
				printf("0 %d\n",n/3);
				flag=0;
				break;
			
			}
			if((n-i)%3==0){
				flag=0;
				printf("%d %d\n",i/2,(n-i)/3);
				break;
			}
			else if(n==i){
				flag=0;
				printf("%d 0\n",i/2);
				break;
			}
			else continue;
		}
		if(flag) printf("WA\n");
	
	}
}