Problem A: 购买贺年卡

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

Description

Input

Output

输出共一行一个整数,表示笑笑所花的最少的钱数。

Sample Input Copy

10 4
4 3
6 2
8 10
3 6

Sample Output Copy

36

HINT

Source/Category