#include<stdio.h> int main() { /*freopen("input.txt","r",stdin); freopen("output.txt","w",stdout);*/ int n,m,y=1; while(scanf("%d %d",&n,&m)==2) { int num1[100010],i,j,k=n,l=m,count=0; for(i=0;i<m;i++) { num1[i]=0; } if(n<m)i=m-n; else i=n-m; while(1) { i=(i+n)%m; num1[i]++; if(num1[i]==2)break; count++; } if(count==m)printf("%10ld%10ld Good Choice\n\n",k,l); else printf("%10ld%10ld Bad Choice\n\n",k,l); y=2; } return 0; }
No comments:
Post a Comment