12, 14求助
查看原帖
12, 14求助
754650
wsxcqqnbzgl楼主2022/8/16 21:52
#include <iostream>
int main() {
	int n, ans = 190009;
	scanf("%d", &n);
	for (int i = 1, x, y; i <= 3; ++i) {
		scanf("%d%d", &x, &y);
		int t = n / x;
		if (t * x < n) ++t;
		ans = std::min(ans, t * y);
	}
	printf("%d", ans);
	return 0;
}
2022/8/16 21:52
加载中...