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

30232번 - Drake Robbing 다국어

시간 제한메모리 제한제출정답맞힌 사람정답 비율
5 초 (추가 시간 없음) 1024 MB137350.000%

문제

A greedy drake in a long-forgotten castle stores their treasures. The drake is obsessed with certain types of treasures. It has been rumored that although the types are few, the volume is plenty. You know that the treasures would be worth a lot in the black market, which is why you waited with your carrying pack for the time when the drake leaves to pillage a nearby town.

When you enter the drake’s abode, you notice near countless treasures and you are afraid that your pack may not be big enough. You are not planning on a return trip so your goal will be to get the most value out of this one and only opportunity.

Given the number of treasure types (each with some multiplicity, worth, and volume), and some maximum volume that can be carried, determine the most worth you can carry within the given volume limit.

입력

The first input line contains two integers: n (1 ≤ n ≤ 20), indicating the number of treasure types and V (1 ≤ V ≤ 1015), indicating the maximum volume you can carry. Each of the next n input lines contains three integers: m (1 ≤ m ≤ 1015), indicating the multiplicity of the item, w (1 ≤ w ≤ 103), indicating the worth of each of this item, and v (1 ≤ v ≤ 103), representing the volume of each of this item.

출력

Print the maximum worth you can carry.

제한

예제 입력 1

3 100
20 1 1
12 5 4
10 11 10

예제 출력 1

117

예제 입력 2

1 1000000000000
1000000000000 1000 1

예제 출력 2

1000000000000000

힌트

출처

University > University of Central Florida > 2023 Local Programming Contest (Final Round) 9번

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

출처

대학교 대회

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

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