Result: Accepted
Time: 1ms
Memory: 1092kB
#include<stdio.h>
#include<string.h>
#include<stdlib.h>
struct name{
char a[100];
int b;
int c;
int d;
};
int comp(const void *p,const void *q){
return ((struct name * )q)->d - ((struct name * )p)->d;
}
int comp2(const void *p,const void *q){
return ((struct name * )p)->b - ((struct name * )q)->b;
}
int main(void){
int t,i,j,p,q,x,y,k,l;
int n,m;
int a,b;
char c;
struct name g[200];
scanf("%d",&t);
while(t--){
scanf("%d",&n);
m=n%3;
if(n==1||n==0) printf("WA\n");
else if(m==0) printf("%d %d\n",0,n/3);
else if(m==1) printf("%d %d\n",2,n/3-1);
else if(m==2) printf("%d %d\n",1,n/3);
}
return 0;
}