A.Red and Blue Beans
#include <bits/stdc++.h>
using namespace std;
int main(){
int t;
cin>>t;
while(t--){
int r,b,d;
cin>>r>>b>>d;
int num=min(r,b);
int num1=max(r,b);
int tag=num1/num;
int tag1=num1%num;
if(tag1){
tag++;
}
if(tag-1>d){
cout<<"NO"<<endl;
}
else{
cout<<"YES"<<endl;
}
}
return 0;
}
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
ll t ,r,b,d;
void solve(){
if(r<b) swap(r,b);
if(b+b*d>=r){
cout<<"YES"<<endl;
}
else {
cout<<"NO"<<endl;
}
}
int main(){
cin>>t;
while(t--){
cin>>r>>b>>d;
solve();
}
return 0;
}
B.The Cake Is a Lie
#include<iostream>
#include<algorithm>
#include<vector>
#include<queue>
#include<map>
#include<cmath>
#include<cstring>
#include<string>
#include<cstdio>
#include<stack>
using namespace std;
typedef long long ll;
typedef pair<int, int> PII;
const int mod = 1e9 + 7;
int main(){
int t;
cin>>t;
while(t--){
int n, m, k;
cin >> n >> m >> k;
if(k == n * m - 1){
cout << "YES" << endl;
}
else{
cout << "NO" << endl;
}
}
return 0;
}