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

#include<stdio.h>
#include<string.h>
#include<stdlib.h>
#include<math.h>
int main()
{
	int t;
	scanf("%d",&t);
	while(t--)
	{
		int n,i,b=0;
		scanf("%d",&n);
		if(n%3==0&&n!=0)
		{
			printf("0 ");
			printf("%d\n",n/3);
		}
		else
		{
			for(i=2;i<=n;++i)
			{			
				if((n-i)%3==0)
				{
					b=1;
					break;
				}
				++i;
			}
			if(n==1||n==0)
			{
				printf("WA\n");
			}
			else if(b==0)
			{
				printf("WA\n");
			}
			else
			{
				printf("%d %d\n",i/2,(n-i)/3);
			}
		}
	}
}