jewel box


jewel box

§Lisa collect beautiful pearls and want to buy jewel boxes to store them. The boxes come in two types:§Type 1:each such box costs c1 dollars and can hold exactly n1 pearls.§Type 2: each such box costs c2 dollars and can hold exactly n2 pearls. §She want each box to be filled to its capacity, and also to minimize the total cost of buying them. §Help Lisa find the best way to distribute her pearls among the boxes.Input§The input file may contain multiple test cases.§ Each test case begins with a line containing the integer n (0<n<1000). §The second line contains c1 and n1, and the third ..........



원문링크 : jewel box