This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#include <bits/stdc++.h>
using namespace std;
int main() {
ios::sync_with_stdio(0);
cin.tie(0);
int s, q;
cin >> s >> q;
while (q--) {
vector<long long> c(2), f(2), mn(2, LLONG_MAX);
cin >> c[0] >> f[0] >> c[1] >> f[1];
for (int i = 0; i < 2; ++i) {
for (int j = 0; j <= f[i ^ 1]; ++j) {
long long damage = c[i] - (f[i ^ 1] - j) * s;
if (damage > 0) {
mn[i] = min(mn[i], (c[i ^ 1] + damage - 1) / damage + j);
}
}
}
cout << (mn[0] <= mn[1] ? "YES" : "NO") << '\n';
}
}
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |