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

33094번 - Diet Plan 다국어

시간 제한메모리 제한제출정답맞힌 사람정답 비율
1 초 2048 MB126685249.524%

문제

You have a diet plan for the next $N$ days (numbered from 1ドル$ to $N$). During day $i,ドル you need to drink exactly $P_i$ mL of milk. Alternatively, you can consume a biscuit instead, as a replacement for milk on that day.

Currently, you only have $M$ mL of milk and $K$ biscuits. If there is not enough milk to drink on a day and you run out of biscuits, then your diet plan stops.

Determine the maximum number of days you can maintain your diet plan.

입력

The first line consists of three integers $N$ $M$ $K$ (1ドル ≤ N ≤ 100$; 0ドル ≤ M, K ≤ 100$).

The next line consists of $N$ integers $P_i$ (1ドル ≤ P_i ≤ 100$).

출력

Output a single integer representing the maximum number of days you can maintain your diet plan.

제한

예제 입력 1

7 100 2
70 30 20 40 50 40 10

예제 출력 1

5

You can consume a biscuit on day 1ドル$ and 4ドル$ to maintain your diet plan for 5ドル$ days.

예제 입력 2

7 70 1
70 30 40 20 50 10 60

예제 출력 2

3

You can consume a biscuit on day 1ドル$ to maintain your diet plan for 3ドル$ days.

예제 입력 3

7 0 100
100 100 100 100 100 100 100

예제 출력 3

7

예제 입력 4

7 0 0
1 1 1 1 1 1 1

예제 출력 4

0

힌트

출처

ICPC > Regionals > Asia Pacific > Indonesia > Indonesia National Contest > INC 2023 B번

ICPC > Regionals > Asia Pacific > Indonesia > Indonesia National Contest > INC 2024 연습 세션 PB번

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

출처

대학교 대회

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

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