#P314. (黑)Kitty
(黑)Kitty
題目描述
one day!
There is a kitty passing by
It...too hungry and died...
When she arrives in Heaven, met the Cat who died before,
it became the God of Cat!
He was a very clever when he was alive,
So he gave the passing kitty a chance to resurrect.
Give it a bag of cat feed, each feed has a different volume and satiety.
As long as the passing kitty can eat the fullest within a limited amount of food,
Then it can be resurrected!
Write a program to help the passing kitty! Meow ~~ !
輸入格式
The first line has a positive integer n (1<n<=10000), which means there are n cat feeds
The next n lines, each line has two positive integers a b,
a represents the volume of the cat’s feed,
b represents satiety (1<=a<=100, 1<=b<=5000)
And kitty can eat up to 100 volumes of feed.
輸出格式
Please output the maximum satiety that this bag of cat feed can bring to kitty !
Samples
6
10 8
25 25
65 75
25 28
25 17
15 20
Max satiety : 111
原始資料
- Zero1 題號:
a314 - Hydro 題號:
Z0314 - Locale:
zh_TW - Display:
practice