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

#include <stdio.h>
int main()
{
	int t,n,i,j;
	
	scanf("%d",&t);
	while(t--)
	{
		scanf("%d",&n);
		if(n<2)
			printf("WA\n");
		if(n>=2)
		{
			for(i=0;i<2501;i++)
			{
				for(j=0;j<1668;j++)
				{
					if((i*2+j*3)==n)
					{
						printf("%d %d\n",i,j);
						break;
					}
					else if(i*2+j*3>n)
					{
						j=0;
						break;
					}
					
				}
				if((i*2+j*3)==n)
						break;
				if(i==2500&&i*2+j*3!=n)
					printf("WA\n");
			}
		}
	}
}