#470. c

c

Background

Special for beginners, ^_^

Description

有一个背包,容量为m。现在有n个物品,质量和价值分别为wi,ci,求可行方案内中背包内物品最大价值。

Format

Input

Output

Samples

3 100
5 2
6 3
7 6
11
4 20
5 2
6 3
17 10
3 8
18

Limitation

对于20%的数据,n<=1000. 对于100%的数据,n<=100000, wi,ci<=20