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: 8ms
Memory: 1700kB
Author: mmseasons
In contest: 1084

#include<iostream>
#include<stdio.h>
#include<string>
#include<cstring>
#include<cmath>
#include<algorithm>
using namespace std;

int main(){
	int t;
	cin>>t;
	while(t--){
		int n,x,y,flag=0;
		cin>>n;
		for(x=0;x*2<=n;x++){
			for(y=0;y*3+x*2<=n;y++){
				if(x*2+y*3==n){
					printf("%d %d\n",x,y);
					flag=1;
					break;
				}
			}
			if(flag)break;
		}
		if(!flag)printf("WA\n");
	}

}