显示代码纯文本
#include<bits/stdc++.h>
using namespace std;
int n;
int read(){
int x=0,f=1;
char ch=getchar();
while(ch<'0'||ch>'9'){
if(ch=='-')
f=-1;
ch=getchar();
}
while(ch>='0'&&ch<='9'){
x=(x<<1)+(x<<3)+(ch^48);
ch=getchar();
}
return x*f;
}
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){
puts("No");
}
else{
puts("Yes");
}
}
int main(){
freopen("noi_online2020_color.in","r",stdin);
freopen("noi_online2020_color.out","w",stdout);
n=read();
int a,b,c;
for(int i=1;i<=n;i++){
a=read();
b=read();
c=read();
if(c<=1){
puts("No");
continue;
}
work(a,b,c);
}
return 0;
}