代码
#include <iostream>
using namespace std;
int main()
{
int a,b,c,d,e,f,g,h,i,j;
cin>>a;
cin>>b>>c;
cin>>d>>e;
cin>>f>>g;
if(a%b!=0){
h=(a/b+1)*c;
}
else if(a%b==0){
h=(a/b)*c;
}
if(a%d!=0){
i=(a/d+1)*e;
}
else if(a%d==0) {
i=(a/d)*e;
}
if(a%f!=0){
i=(a/f+1)*g;
}
else if(a%f==0){
j=(a/f)*g;
}
if(i<h){
if(i<j){
cout<<i;
}else if(i>j){
cout<<j;
}
}else if(h<j){
cout<<h;
}else if(h>j){
cout<<j;
}
return 0;
}