The Spellbook

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

문제

You have a spellbook with nn spells. The spells are numbered by sequential integers from 11 to nn, and the spell ii (1in1 \le i \le n) initially costs A_iA\_i MP (mana points). Initially you have mm MP.

Your goal is to cast each spell from the spellbook exactly once.

Before you start casting spells, you can eat up to kk cookies. Eating a cookie takes zero time. Each time you eat a cookie, you can choose a spell with a positive cost and reduce that cost by 11.

After eating cookies, you start casting spells.

You can repeatedly choose and perform one of the following actions:

  • Choose an integer ii (1in1 \le i \le n) and cast the spell ii. However, the current MP must be greater than or equal to A_iA\_i. This action takes zero time and decreases your MP by A_iA\_i.
  • If your MP is z<mz < m, you may take a rest to restore 11 MP. It takes mzm - z seconds (for example, if m=5m = 5 and z=2z = 2, you need to rest for 33 seconds to regenerate MP from 22 to 33).

Find the minimum amount of time you can spend to cast each of the nn spells exactly once. You are free to select the order of the spells.

입력

First line of the input contains three integers nn, mm and kk: the number of spells, the initial MP value and the number of cookies, respectively. The second line contains nn integers A_iA\_i: the initial costs of the spells in MP (1n1051 \le n \le 10^5, 1m1061 \le m \le 10^6, 1A_im1 \le A\_i \le m, 0k_i=1nA_i0 \le k \le \sum\limits\_{i=1}^n A\_i).

출력

Print one integer: the minimum amount of time it takes to cast each of the nn spells exactly once.