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;
long long sub1(int s, int n, vector<array<int, 3>> &a) {
array<int, 3> cur = a[0];
int taken = min(s / cur[1], cur[2]);
return 1LL * taken * cur[0];
}
signed main() {
cin.tie(nullptr)->sync_with_stdio(false);
int s, n; cin >> s >> n;
vector<array<int, 3>> a(n);
for (array<int, 3> &it: a) {
cin >> it[0] >> it[1] >> it[2];
}
if (n == 1) cout << sub1(s, n, a);
}
# | 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... |