标签:
Time Limit: 5000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)
Total Submission(s): 1042 Accepted Submission(s):
448
#include <cstdio> #include <cstring> #include <iostream> using namespace std; __int64 gcd(__int64 x, __int64 y){ return x%y==0? y:gcd(y, x%y); } int main(){ __int64 x, y; while(~scanf("%I64d%I64d", &x, &y), x+y){ printf(gcd(x, y) == 1? "%I64d\n":"Inf\n", x*y-x-y); } return 0; }
标签:
原文地址:http://www.cnblogs.com/fengshun/p/4914972.html