【2016NOIP普及组】T1 买铅笔

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;
}
原创文章 157 获赞 148 访问量 8302

猜你喜欢

转载自blog.csdn.net/bigwinner888/article/details/105878842