65,187
社区成员




本题的来源是:http://acm.fjnu.edu.cn/show?problem_id=1336
下面代码已经AC
#include <iostream>
using namespace std;
int gcd(int a, int b){return b ? gcd(b, a%b) : a;}
int main()
{
int cas;scanf("%d", &cas);
while (cas--)
{
int l, m, n;scanf("%d%d%d", &l, &m, &n);
int d = gcd(l, m);
d = gcd(d, n);
l /= d;
m /= d;
n /= d;
if ((m+n)&1)puts("no");
else printf("%d\n", n+m-1);
}
return 0;
}