#P2376. Choose the candies

Choose the candies

题目描述

Rookie has a friend who is a big foodie, and his favorite food is candy, he has an ability to make the number of candies infinite, so that he can eat endless candies, but he will have bad teeth if he eats too much, so now give him a magic bag, which you can use to control its size or capacity, but you are also a compassionate person, you will let him eat the most candy, now please use the program to help him

输入格式

The first row of two integers, N and V, separated by spaces, represents the number of items and the dorsal inclusion product respectively.

Next are N lines, each of which are two integers, vi, wi, separated by spaces, representing the volume and value of the item i.

输出格式

The most you can get to the sugar

样例

4 5 
1 2 
2 4 
3 4 
4 5
10
3 5 
1 3 
2 1 
3 6
15

提示

This question is a template question, which is very simple.It's just a question to lay the groundwork.

By TOP