#include <stdio.h>
int main() {
unsigned long long sum,sumX;
int step,mod,seed;
while (EOF!=scanf("%d%d",&step,&mod)) {
sum=sumX=0; seed=0;
for (int i=0;i<mod;++i) {
sumX+=i; sum +=seed; seed=(seed+step)%mod;
}
printf("%10d%10d %s Choice\n\n",step,mod,(sum==sumX?"Good":"Bad"));
}
return 0;
}
Saturday, 21 March 2009
HOJ ( acm.hdu.edu.cn ) 1014
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment