Preparing NOJ

Coins

1000ms 65536K

Description:

There are N kinds of coins. Each kind of coins has a value V and a weight W. Tony wants to go traveling. Unfortunately, he can only carry coins of which the total weight is not greater than K. How much total value of coins can he carry at most?

Input:

First line: two positive integers N (N <= 100) and K (K <= 1000).
Next N lines: the i-th line two positive integers V and W (V,W <= 1000) indicating the value and the weight of the i-th coin.

Output:

One integer indicating the total value of coins at most.

Sample Input:

3 7
1 2
2 3
4 5

Sample Output:

5

Info

NOIOPEN

Provider NOIOPEN

Origin 简单英文题

Code NOIOPJENGLISH18

Tags

Submitted 0

Passed 0

AC Rate 0%

Date 08/15/2021 18:56:23

Related

Nothing Yet