我的答案
#include<bits/stdc++.h>
using namespace std;
int n;
struct hhh
{
int num;
int money;
}a,b,c;
int main()
{
int min;
cin>>n;
cin>>a.num>>a.money>>b.num>>b.money>>c.num>>c.money;
int agreat=0,bgreat=0,cgreat=0;
while(agreat*a.num<n)
agreat++;
while(bgreat*b.num<n)
bgreat++;
while(cgreat*c.num<n)
cgreat++;
agreat*=a.money;
bgreat*=b.money;
cgreat*=c.money;
min=(agreat<bgreat)?((agreat<cgreat)?agreat:cgreat):((bgreat<cgreat)?bgreat:cgreat);
cout<<min;
}
using namespace std;
int n;
struct hhh
{
int num;
int money;
}a,b,c;
int main()
{
int min;
cin>>n;
cin>>a.num>>a.money>>b.num>>b.money>>c.num>>c.money;
int agreat=0,bgreat=0,cgreat=0;
while(agreat*a.num<n)
agreat++;
while(bgreat*b.num<n)
bgreat++;
while(cgreat*c.num<n)
cgreat++;
agreat*=a.money;
bgreat*=b.money;
cgreat*=c.money;
min=(agreat<bgreat)?((agreat<cgreat)?agreat:cgreat):((bgreat<cgreat)?bgreat:cgreat);
cout<<min;
}