Logo
(追記) (追記ここまで)

15407번 - How to Eat at a Buffet 다국어

시간 제한메모리 제한제출정답맞힌 사람정답 비율
2 초 512 MB66565086.207%

문제

Instead of a seated meal, some restaurants offer all-you-can-eat buffet lunches and dinners. This is usually a bargain for famished students. Alice likes such buffet meals, but is always worried about how best to fill her plate with food. She values the n different items on the menu differently, and her goal is to have as much value as she can on her plate, constrained by the limited area of the plate and the limited availability of some menu items. Luckily, items on the menu are easily dividable and Alice can take an arbitrary fraction of each dish. Can you help her fill her plate?

입력

The input is formed of n + 2 lines:

  • the first line consists of the number n of different items on the menu;
  • the second line consists of the area a of Alice’s plate, an integer in mm2;
  • each of the n remaining lines consists of information about a menu item, as two integers separated with a space; the first one is the value vi of item i per mm2, as perceived by Alice; the second one is the area ai, in mm2, that item i would occupy if Alice were to transfer it fully to her plate.

Limits

  • 1 ≤ n ≤ 1 000
  • 0 ≤ a ≤ 100 000
  • For every 0 ≤ i ≤ n − 1:
    • 0 ≤ vi ≤ 100;
    • 0 ≤ ai ≤ 100 000 000.

출력

A single line consisting of an integer: the maximal value that Alice can fit on her plate.

제한

예제 입력 1

5
1000
50 230
80 12
10 1000000
25 450
2 50

예제 출력 1

26790

힌트

출처

ICPC > Regionals > Europe > Southwestern European Regional Contest > SWERC 2017 연습 세션 PC번

(追記) (追記ここまで)

출처

대학교 대회

  • 사업자 등록 번호: 541-88-00682
  • 대표자명: 최백준
  • 주소: 서울시 서초구 서초대로74길 29 서초파라곤 412호
  • 전화번호: 02-521-0487 (이메일로 연락 주세요)
  • 이메일: contacts@startlink.io
  • 통신판매신고번호: 제 2017-서울서초-2193 호

AltStyle によって変換されたページ (->オリジナル) /