2019-01-29HDU - 1495
2019-01-29 本文已影响0人
林锦天
[HDU - 1495]
include<iostream>
using namespace std;
int gcd(int a, int b)
{
return b ? gcd(b, a%b) : a;
}
int main()
{
int a, b, c;
while (cin>>a>>b>>c&&(a!=0||b!=0||c!=0))
{
a =a/ gcd(b, c);
if (a & 1)
cout << "NO" << endl;
else
cout<<a-1<<endl;
}
}