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

#include <stdio.h>
#include<math.h>
int main()
{
  int t;
  scanf("%d",&t);
  while(t--)
  {
	  int a,b,c;
	  scanf("%d",&a);
	  if(a<=1)
		  printf("WA\n");
	  if(a==2)
		  printf("1 0\n");
	  if(a==3)
		  printf("0 1\n");
	  if(a==4)
		  printf("0 2\n");
	  if(a>4)
	  {
		  b=a%3;
		  c=a/3;
		  if(b==0)
			  printf("0 %d\n",c);
		  if(b==1)
			  printf("2 %d\n",c-1);
		  if(b==2)
			  printf("1 %d\n",c);

	  }
  }
}