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

문제

A class of n music students are going to rehearse for a concert in a recital hall. In one rehearsal pass, each student will give one performance in order from student 1 to student n. Student i’s performance has a duration of di. After the last student’s performance concludes, a new rehearsal pass will start immediately, beginning with the performance of student 1.

On each day, the recital hall will be open for a fixed duration of p. At any moment if the next student’s performance cannot complete before the recital hall closes, all the remaining performances within the current rehearsal pass will be moved to the next day.

In k days, how many full rehearsal passes can the class complete?

입력

The first line of input contains three integers n, p, k (1 ≤ n ≤ 2 · 105, 1 ≤ p, k ≤ 109). Each of the next n lines contains a single integer. The ith line gives di (1 ≤ di ≤ p).

출력

Output the number of full rehearsal passes the class can complete in k days.

예제 입력 1

3 9 5
1
2
3

예제 출력 1

7

예제 입력 2

4 10 5
3
2
4
6

예제 출력 2

2

예제 입력 3

3 10 2
5
6
7

예제 출력 3

0