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

#include <stdio.h>
int main(void)
{
	int T,N,t;
	scanf("%d",&T);
	while(T--)
	{
		scanf("%d",&N);
		for(int i=0;i<=N*1.0/2;++i)
		{
			if((N-2*i)%3==0)
			{
			for(int j=0;j<=(N-2*i)*1.0/3;++j)
			{
				if(2*i+3*j==N)
				{
					printf("%d %d\n",i,j);
					t=j;
					break;
				}
			
			}
			
			if(2*i+3*t==N)
			{
				break;
			}
			
			}
			if(2*i>N||N==1)
				printf("WA\n");
		
		}
	}
	return 0;
}