python代码
from math import ceil # math 自带的库 向上取整
ps = int(input())
p1,m1 = list(map(int,input().split(" ")))
p2,m2 = list(map(int,input().split(" ")))
p3,m3 = list(map(int,input().split(" ")))
p1s = ceil(ps/p1) * m1
p2s = ceil(ps/p2) * m2
p3s = ceil(ps/p3) * m3
print(min([p1s,p2s,p3s]))
# 注意 跑数据时 将注释删掉


![P1909 [NOIP2016 普及组] 买铅笔 python题解 P1909 [NOIP2016 普及组] 买铅笔 python题解](http://www.mshxw.com/aiimages/31/461779.png)
