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

#include<stdio.h>
#include<string.h>
#include<math.h>
#include<stdlib.h>
struct stu
{
	char a[100];
	int c,b,zongfen;
};
int sx(const void *p,const void *q)
{
	return ((struct stu*)q)->zongfen-((struct stu*)p)->zongfen;
}
int main()
{
	int t;
	scanf("%d",&t);
	while(t--)
	{
		int a;
		scanf("%d",&a);
		if(a==1)
			printf("WA\n");
		else if(a==2)
			printf("1 0\n");
		else if(a==3)
			printf("0 1\n");
		else
		{
			if(a%3==0)
			{
				printf("0 %d\n",a/3);
			}
			else if(a%3==2)
			{
				printf("1 %d\n",a/3);
			}
			else if(a%3==1)
			{
				printf("2 %d\n",a/3-1);
			}
		}
	}
}