这是小学数学题吧??
#include <iostream>
using namespace std;
int n, n1, p1, n2, p2, n3, p3;
int main(void) {
cin >> n >> n1 >> p1 >> n2 >> p2 >> n3 >> p3;
int num = 0, cost1 = 0;
while (num < n) {
cost1 += p1;
num += n1;
}
num = 0; int cost2 = 0;
while (num < n) {
cost2 += p2;
num += n2;
}
num = 0; int cost3 = 0;
while (num < n) {
cost3 += p3;
num += n3;
}
cout << min(cost1, min(cost2, cost3)) << endl;
return 0;
}