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

#include <stdio.h>
#include <math.h>
int main(){  
  int t;
  int n;
  int i,j,k;
  scanf("%d",&t);
  while(t--){
	  i=0,j=0;
	  scanf("%d",&n);
	  if(n==1) printf("WA\n");
	  else if(n==2) printf("1 0\n");
	  else if(n==3) printf("0 1\n");
	  else if(n%3==0){
		  while(n>0){
			  n-=3;
			  j++;
		  }
		  printf("0 %d\n",j);
	  }
	  else{
		  while(n%3!=0){
			  n-=2;
			  i++;
		  }
		  while(n>0){
			  n-=3;
			  j++;
		  }
		  printf("%d %d\n",i,j);
	  }
  }
  return 0; 
}