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

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





				}
				else
				{
				y=n/3;
				n=n-3*y;
				x=n/2;
				printf("%d %d\n",x,y);
				}
			}		
		}


	}
	return 0;
}