4593: P1208 [USACO1.3] 混合牛奶 Mixing Milk

Memory Limit:128 MB Time Limit:1.000 S
Judge Style:Text Compare Creator:
Submit:0 Solved:0

Description

Input

Output

Sample Input Copy

100 5
5 20
9 40
3 10
8 80
6 30

Sample Output Copy

630

HINT