///...................SUBHASHIS MOLLICK....................///
///.....DEPARTMENT OF COMPUTER SCIENCE AND ENGINEERING....///
///.............ISLAMIC UNIVERSITY,BANGLADESH.............///
///.....................SESSION-(14-15)....................///
#include<stdio.h>
#include<string.h>
#include<math.h>
#include<algorithm>
#include<ctype.h>
#include<bits/stdc++.h>
using namespace std;
int main()
{
long step,mode;
while(scanf("%ld %ld",&step,&mode)==2)
{
long num[mode+1],count=0,i,j=0;
for(i=0;i<=mode;i++)
{
num[i]=0;
}
j=0;
while(1)
{
num[j]++;
if(num[j]==2)
break;
j=(j+step)%mode;
count++;
}
if(count==mode)printf("%10ld%10ld Good Choice\n\n",step,mode);
else printf("%10ld%10ld Bad Choice\n\n",step,mode);
}
return 0;
}
///.....DEPARTMENT OF COMPUTER SCIENCE AND ENGINEERING....///
///.............ISLAMIC UNIVERSITY,BANGLADESH.............///
///.....................SESSION-(14-15)....................///
#include<stdio.h>
#include<string.h>
#include<math.h>
#include<algorithm>
#include<ctype.h>
#include<bits/stdc++.h>
using namespace std;
int main()
{
long step,mode;
while(scanf("%ld %ld",&step,&mode)==2)
{
long num[mode+1],count=0,i,j=0;
for(i=0;i<=mode;i++)
{
num[i]=0;
}
j=0;
while(1)
{
num[j]++;
if(num[j]==2)
break;
j=(j+step)%mode;
count++;
}
if(count==mode)printf("%10ld%10ld Good Choice\n\n",step,mode);
else printf("%10ld%10ld Bad Choice\n\n",step,mode);
}
return 0;
}
কোন মন্তব্য নেই:
একটি মন্তব্য পোস্ট করুন