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: 371ms
Memory: 1712kB
Author: fyk19980409
In contest: 1084

#include<iostream>
#include<cstdio>
#include<cmath>
#include<cstring>
#include<cstdlib>
using namespace std;
typedef long long ll;
struct node
{
	char nam[100];
	int c;
}cord[100];
int main()
{
	int t;
	cin>>t;
	while(t--)
	{
		int n;
		cin>>n;
		int x=0,y=0;
		if(n==0)
		{
			cout<<"0 0"<<endl;
		}else
		{
			for(int i=0;i<n/3+10;i++)
		{
			for(int j=0;j<n/2+10;j++)
			{
				if(i*3+j*2==n)
				{
					x=i;
					y=j;
				}
			}
		}
		if(x==0&&y==0)
		{
			cout<<"WA"<<endl;
		}else
		{
			cout<<y<<" "<<x<<endl;
		}
		}
		
	}
}