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

#include<stdio.h>
void main()
{
	int T,n,x,y;
	scanf("%d",&T);
	while(T--)
	{
		scanf("%d",&n);
		x=0;
		y=0;
		if(n==0)
		{
			printf("0 0\n");
		}
		else if(n==1)
		{
			printf("WA\n");
		}
		else
		{
		     for(int i=0;i<=(n/2+1);++i)
		     {
			       if((n-2*i)%3==0)
			       {
				     x=i;
                     y=(n-2*x)/3; 
					 if(x!=(n/2+1))
					 {
						 if(y>=0)
                     printf("%d %d\n",x,y);
						 else
							 printf("wa\n");
					 }
                     break;
			        }
				  
		         
		}
		}
	}
}