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

#include<stdio.h>
#include<string.h>
#include<stdlib.h>
#include<math.h>
int comp(const void *p,const void *q)
{
	return *(int *)q - *(int *)p;
}
void main()
{
	int n,i,t,j,c;
	scanf("%d",&n);
	for(i=0;i<=n-1;++i)
	{
		scanf("%d",&t);
		for(j=0,c=0;j<=t-1;++j)
		{
			if((t-2*j)%3==0)
			{
				c = 1;
				printf("%d %d\n",j,(t-2*j)/3);
				break;
			}
		}
		if(c==0)
		    printf("WA\n");
	}
}