♻️lzhh_lzhh32 • 4个月前
#include <bits/stdc++.h>
using namespace std;
int main(){
int n, a1, a2, b1, b2, c1, c2;
cin>>n>>a1>>a2>>b1>>b2>>c1>>c2;
int m1, m2, m3;
if(n%a1!=0){
m1=n/a1+1;
m1*=a2;
}else{
m1=(n/a1)*a2;
}
if(n%b1!=0) {
m2=n/b1+1;
m2*=b2 ;
}else{
m2=(n/b1)*b2;
}
if(n % c1 != 0) {
m3=n/c1+1;
m3*=c2 ;
}else{
m3=(n/c1)*c2;
}
if(m2>m1&&m3>m1){
cout<<m1;
}else if(m1> m2 && m3 > m2){
cout<<m2;
}else{
cout<<m3;
}
return 0;
}
评论:
请先登录,才能进行评论