[MTV]王强_秋天不回来(320*240)

潇潇风雨

普通会员
2006-10-14
3
0
0
#include<stdio.h>
bool poor[100000];
int main()
{
int step;
int mod;
int i;
int num;
int x1;
bool rich;
freopen("1109.txt","r",stdin);
freopen("out.txt","w",stdout);
while(scanf("%d %d",&step,&mod)>0)
{
printf("%10d%10d ",step,mod);
for(i=mod-1;i;i--)
{
poor=false;
}
for(i=0;i<mod;i++)
{
if(poor)
{
continue;
}
num=1;
x1=i;
poor[x1]=true;
rich=false;
while(1)
{
x1=(x1 + step) % mod;
poor[x1]=true;
if(x1!=i)
{
num++;
if(num==mod)
{
rich=true;
break;
}
}
else
{
break;
}
}
if(rich)
{
printf("Good Choice\n\n");
break;
}
}
if(!rich)
{
printf("Bad Choice\n\n");
}
}
return 0;
}