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

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