666

晴天  •  4个月前


include <bits/stdc++.h>

using namespace std;

int main() {

int z, a, b, c, q1, q2, q3, bj, a1, a2, b1, b2, c1, c2;
cin >> z;
cin >> a1 >> a2 ;
cin>> b1 >> b2;
cin>> c1 >> c2;
if (z % a1 == 0) {
	a = z / a1;
} else {
	a = z / a1 + 1;
}
q1 = a * a2;

if (z % b1 == 0) {
	b = z / b1;
} else {
	b = z / b1 + 1;
}
q2 = b * b2;

if (z % c1 == 0) {
	c = z / c1;
} else {
	c = z / c1 + 1;
}
q3 = c * c2;
if (q1 < q2) {
	bj = q1;
} else {
	bj = q2;
}
if (q3 < bj) {
	bj = q3;
}
cout << bj;
return 0;

}


评论:

请先登录,才能进行评论