显示代码纯文本
#include<bits/stdc++.h>
using namespace std;
int n;
int gcd(int a,int b){
if(a<b){
swap(a,b);
}
while(b){
a%=b;
swap(a,b);
}
return a;
}
void work(int p1,int p2,int k){
int temp,z;
z=gcd(p1,p2);
p1/=z;
p2/=z;
if(p1<p2){
swap(p1,p2);
}
temp=p1/p2;
if(p1%p2>1){
temp++;
}
else{
if(p1%p2==0){
temp--;
}
}
if(temp>=k){
cout<<"No"<<endl;
}
else{
cout<<"Yes"<<endl;
}
}
int main(){
freopen("color.in","r",stdin);
freopen("color.out","w",stdout);
ios::sync_with_stdio(0);
cin.tie(0);
cout.tie(0);
cin>>n;
int a,b,c;
for(int i=1;i<=n;i++){
cin>>a>>b>>c;
if(c<=1){
cout<<"No"<<endl;
continue;
}
work(a,b,c);
}
return 0;
}