Codechef•Sep 07, 2025
Multivitamin Tablets
Hazrat Ali
Codechef
Determine if Chef has enough tablets for these X days or not.
Input Format
- The first line contains a single integer T — the number of test cases. Then the test cases follow.
- The first and only line of each test case contains two space-separated integers X and Y — the number of days Chef needs to take tablets and the number of tablets Chef already has.
Output Format
For each test case, output YES if Chef has enough tablets for these X days. Otherwise, output NO.
You may print each character of YES and NO in uppercase or lowercase (for example, yes, yEs, Yes will be considered identical).
Constraints
- 1≤T≤2000
- 1≤X≤100
- 0≤Y≤1000
Sample 1:
Input
4 1 10 12 0 10 29 10 30
Output
YES NO NO YES
Solution
#include <iostream>
using namespace std;
int main() {
int t;
cin >> t;
while (t--) {
int x, y;
cin >> x >> y;
if (y / 3 >= x) {
cout << "YES" << endl;
} else {
cout << "NO" << endl;
}
}
return 0;
}