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.

19 lines
477 B

#include <bits/stdc++.h>
using namespace std;
int n, a, b, c, ans = INT_MAX, x, i;
int main() {
ios::sync_with_stdio(false); //读入输出优化的强迫症
cin >> n;
for (; i < 3; i++) {
cin >> a >> b;
//floor(x)返回的是小于或等于x的最大整数。
//ceil(x)返回的是大于x的最小整数。
x = ceil(n * 1.0 / a) * b;
//取最小值
ans = min(x, ans);
}
cout << ans << endl;
return 0;
}