Each case in the input begins with n (1 ≤ n ≤ 1000), denoting the number of categories. Each of the
following n lines describes a category. A category is described by 4 integers - V (1 ≤ V ≤ 132000), the
voltage rating, K (1 ≤ K ≤ 1000), the cost of a voltage source of this rating, C (1 ≤ C ≤ 10), the cost
of a lamp of this rating and L (1 ≤ L ≤ 100), the number of lamps required in this category. The input
terminates with a test case where n = 0. This case should not be processed.
Output Data
For each test case, print the minimum possible cost to design the system.
Input sample
3
100 500 10 20
120 600 8 16
220 400 7 18
0
Output sample
778
Hint
input data和output data 的英文意思可以忽略
——————————————————分割の线————————————————————