'commit'
This commit is contained in:
19
LuoGu/RuMen/P1909.cpp
Normal file
19
LuoGu/RuMen/P1909.cpp
Normal file
@@ -0,0 +1,19 @@
|
||||
#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;
|
||||
}
|
||||
Reference in New Issue
Block a user