#include <bits/stdc++.h>
using namespace std;
#define ent "\n"
#define all(a) (a).begin(), (a).end()
#define int int64_t
#define pii pair<int,int>
using ld = long double;
const int MOD = 1e9 + 7;
const int inf = 1e18;
int32_t main() {
ios::sync_with_stdio(false);
cin.tie(0);
int s, n;
cin >> s >> n;
vector<array<int, 3>> a(n);
bool isk1 = 1;
for (int i = 0; i < n; ++i) {
cin >> a[i][0] >> a[i][1] >> a[i][2];
if (a[i][2] != 1) {
isk1 = 0;
}
}
if (n == 1) {
int ans = 0;
for (int i = 1; i <= a[0][2]; ++i) {
if (a[i][1] * i <= s) {
s = a[i][0] * i;
}
}
cout << ans;
}
if (isk1) {
}
}
int binpow(int base, int power) {
if (power == 0) return 1;
if (power == 1) return base;
int x = binpow(base, power / 2);
if (power & 1) return x * x * base;
else return x * x;
}
int lcm(int a, int b) {
return a / __gcd(a,b) * b;
}
# | 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... |