1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29
| #include<bits/stdc++.h> using namespace std; long long T; long long p1,p2,k; inline long long gcd(long long a,long long b){return b==0?a:gcd(b,a%b);} int main() { freopen("color.in","r",stdin); freopen("color.out","w",stdout); cin>>T; while(T--) { cin>>p1>>p2>>k; if(k==1) { cout<<"NO\n"; continue; } if(p1>p2) swap(p1,p2); int t=gcd(p1,p2); p1/=t; p2/=t; puts((p2>2 && (p2-2)/p1+1>=k)?"NO":"YES"); } fclose(stdin); fclose(stdout); return 0; }
|