Frequent Flier

아직 제출이 없습니다시간 제한2초메모리 제한2048 MB

문제

An airline is offering a strange new rewards program to offer free flights to travelers.

The program can be parameterized with two integers mm and kk. Within any mm consecutive months, a traveler must pay for at least kk of those flights (if there are fewer than kk flights in that interval, all of those flights must be paid for). Other flights within that interval are free. Note that this condition needs to be true for all mm-month intervals, including all of the ones that start before your first flight.

You have a schedule of the number of flights you'll take over the next many months. You want to know the minimum number of flights you'll need to pay for.

입력

The first line of input contains three integers nn, mm (1n,m2×1051 \le n,m \le 2 \times 10^5) and kk (1k1091 \le k \le 10^9), where nn is the number of consecutive months ahead that you have flights planned, and mm and kk are the parameters of the airline's rewards program.

Each of the next nn lines contains an integer ff (1f1091 \le f \le 10^9), which is the number of flights you plan to take during that month.

출력

Output a single integer, which is the minimum number of planned flights that you must pay for.