You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

24 lines
629 B

2 years ago
#include <bits/stdc++.h>
using namespace std;
/*
使 n
n
s n/s=(n+s1)/s
*/
int main() {
int n;
scanf("%d", &n);
int res = 1e9;
for (int i = 0; i < 3; i++) {
int s, p;
scanf("%d%d", &s, &p);
res = min(res, (n + s - 1) / s * p);
}
printf("%d\n", res);
return 0;
}