#390
Unrated
Talent Show
시간 제한
2s
메모리 제한
1024MB
제출
0
정답
0
맞힌 사람
0
정답 비율
0.0%

문제

Farmer John is bringing his NN cows, conveniently numbered 1N1 \ldots N, to the county fair, to compete in the annual bovine talent show! His iith cow has a weight wiw_i and talent level tit_i, both integers.

Upon arrival, Farmer John is quite surprised by the new rules for this year's talent show:

(i) A group of cows of total weight at least WW must be entered into the show (in order to ensure strong teams of cows are competing, not just strong individuals), and

(ii) The group with the largest ratio of total talent to total weight shall win.

FJ observes that all of his cows together have weight at least WW, so he should be able to enter a team satisfying (i). Help him determine the optimal ratio of talent to weight he can achieve for any such team.

입력

The first line of input contains NN (1N2501 \leq N \leq 250) and WW (1W10001 \leq W \leq 1000). The next NN lines each describe a cow using two integers wiw_i (1wi1061 \leq w_i \leq 10^6) and tit_i (1ti1031 \leq t_i \leq 10^3).

출력

Please determine the largest possible ratio of total talent over total weight Farmer John can achieve using a group of cows of total weight at least WW. If your answer is AA, please print out the floor of 1000A1000A in order to keep the output integer-valued (the floor operation discards any fractional part by rounding down to an integer, if the number in question is not already an integer).

예제 입력 1

3 15
20 21
10 11
30 31

예제 출력 1

1066
코드 제출

코드를 제출하려면 로그인이 필요합니다.

로그인
내 제출
제출 내역이 없습니다.
맞은 사람
아직 맞은 사람이 없습니다.
난이도 투표
Unrated0명 투표
로그인 후 AC 받으면 투표할 수 있습니다.
전체 제출
제출 내역이 없습니다.