第一次用洛谷,虚心求教:
n = int(input()) d = [] for i in range(3): x,y =map(int,input().split()) d.append(math.ceil(n/x)*y) print(min(d))