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

#include<stdio.h>
#include<math.h>
int main()
{
	int t,n;
	scanf("%d",&t);
	while(t--)
	{
		int i,j,q=0,w=0,ary[10000],bry[10000];
		scanf("%d",&n);
		if(n==1)
			printf("WA\n");
		else
		{
			for(i=0;i<=n/2;i++)
			{
				for(j=n/3;j>=0;j--)
				{
					if(2*i+3*j==n)
					{
						ary[q]=i;
						bry[w]=j;
						q++;
						w++;
					}
				}
			}
			printf("%d %d\n",ary[0],bry[0]);
		}

	}
	return 0;
}