www.pudn.com > zju_1000_1010.rar > 1003_other2.cpp
//accepted //by just for play #includeint can; int test(long a,long b,int c){ if(b==1) can=1; if(a==1&&b==1) return 1; if(c>100) return 0; while(a%c!=0&&b%c!=0&&c<=100){ c++;} if(c>100) return 0; if(a%c==0) if(test(a/c,b,c+1)) return 1; if(b%c==0) if(test(a,b/c,c+1)) return 1; if(test(a,b,c+1)) return 1; return 0; } int main(){ long a,b; while(cin>>a>>b){ can=0; long max=(a>b)?a:b; long min=(a