P1909 买铅笔
题目传送门
#include<cstdio>
#include<iostream>
#include<cmath>
#include<cstring>
#include<string>
#include<algorithm>
#include<vector>
#define fre(x) freopen(#x".in","r",stdin),freopen(#x".out","w",stdout);
using namespace std;
const int MAX=2147483647;
const int N=1e6;
double s1,p1,s2,p2,s3,p3,n,ans;
int main()
{
//fre();
cin>>n;
cin>>s1>>p1>>s2>>p2>>s3>>p3;
ans=ceil(n/s1)*p1;
ans=min(ans,ceil(n/s2)*p2);
ans=min(ans,ceil(n/s3)*p3);
cout<<int(ans)<<endl;
return 0;
}