| 시간 제한 | 메모리 제한 | 제출 | 정답 | 맞힌 사람 | 정답 비율 |
|---|---|---|---|---|---|
| 1 초 | 2048 MB | 126 | 68 | 52 | 49.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.
7 100 2 70 30 20 40 50 40 10
5
You can consume a biscuit on day 1ドル$ and 4ドル$ to maintain your diet plan for 5ドル$ days.
7 70 1 70 30 40 20 50 10 60
3
You can consume a biscuit on day 1ドル$ to maintain your diet plan for 3ドル$ days.
7 0 100 100 100 100 100 100 100 100
7
7 0 0 1 1 1 1 1 1 1
0
ICPC > Regionals > Asia Pacific > Indonesia > Indonesia National Contest > INC 2023 B번
ICPC > Regionals > Asia Pacific > Indonesia > Indonesia National Contest > INC 2024 연습 세션 PB번