0

With reference to thishttp://www.spoj.com/problems/GAMES/, I made a program:
#include<iostream>
using namespace std;
long gcd(long p,long q){
return p == 0 ? q : gcd(q%p , p);
}
int main(){
double a;
int t,b=10000;
cin>>t;
while(t--){
cin>>a;
//cout<<gcd(b,(long)(a*b))<<'\n';//To ...