Result: Accepted
Time: 2ms
Memory: 1092kB
/*该程序功能:输入一个正整数n,计算下列表达式:s=1!+2!+3!+4!+...+n! 的值,并输出。*/
#include <stdio.h>
#include<string.h>
#include<math.h>
#include<stdlib.h>
struct name {
char c[25];
int a;
int b;
};
//int comp(const void *p,const void *q){
//return (*(* ))
//}
int main()
{
struct name s[110],y;
char c;
int a,b,t,n,i,j;
scanf("%d",&t);
while(t--){
scanf("%d",&n);
if(n<2)printf("WA");
else if(n%3==0)printf("0 %d",n/3);
else if(n%3==1)printf("2 %d",(n-4)/3);
else printf("1 %d",n/3);
printf("\n");
}
return 0;
}