Rikka with RCPC

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

문제

Rikka is going to hold a worldwide competition, RCPC (Rikka's collegiate programming contest). 

Preparing for a contest is time-consuming: It will take Rikka nn days. Meanwhile, there are so many questions in the official QQ group of RCPC, raised by contestants, coaches, and even melon eating people. Therefore, Rikka decides to ignore the QQ group on some of the nn days.

However, always ignoring questions may make contestants angry. Before the start of Day 11, the angry value AA of contestants is 00. At the beginning of the ii-th day, the angry value will be increased by a_ia\_i. Then:

  • If AA is strictly larger than a threshold TT, contestants will be extremely angry, and Rikka will receive 2A2A points of attack. Then, at the end of this day, AA will be cleared to 00;
  • If AA is no larger than TT and Rikka chooses to ignore questions, nothing will happen on this day;
  • If AA is no larger than TT and Rikka decides to answer questions, meanwhile, if Rikka ignores all questions on previous KK days, i.e. from Day iKi-K to Day i1i-1, contestants will feel the hardness of Rikka. Rikka will not receive any attack, and at the end of this day, AA will be cleared to 00;
  • Otherwise, even though Rikka chooses to answer questions, contestants will still blame Rikka for answering questions so slowly, and Rikka will receive AA points of attack. At the end of this day, AA will be cleared to 00.

Your task is to help Rikka to decide which days to answer questions so that the total attacks she received is minimized.

입력

The first line contains three integers n,K (1K<n2×105)n,K\ (1 \leq K < n \leq 2 \times 10^5) and T (1T109)T\ (1 \leq T \leq 10^9).

The second line contains nn integers a_i (1a_iT)a\_i\ (1 \leq a\_i \leq T).

출력

Output a single integer, the answer.

힌트

For the first sample, one optimal plan is to answer questions on Day 11 and Day 33:

  • On Day 11, the angry value is 33, and thus Rikka will receive 33 points of attacks.
  • On Day 22, the angry value is 11, and thus nothing will happen;
  • On Day 33, the angry value is 55. Since Rikka does not answer the questions on Day 22, contestants will feel the hardness of Rikka, and thus nothing will happen;
  • On Day 44, the angry value is 22, and thus nothing will happen.