시간 제한 | 메모리 제한 | 제출 | 정답 | 맞힌 사람 | 정답 비율 |
---|---|---|---|---|---|
1 초 | 512 MB | 3 | 3 | 3 | 100.000% |
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 $n$ 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 $n$ days.
However, always ignoring questions may make contestants angry. Before the start of Day $1$, the angry value $A$ of contestants is $0$. At the beginning of the $i$-th day, the angry value will be increased by $a_i$. Then:
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\ (1 \leq K < n \leq 2 \times 10^5)$ and $T\ (1 \leq T \leq 10^9)$.
The second line contains $n$ integers $a_i\ (1 \leq a_i \leq T)$.
Output a single integer, the answer.
4 1 5 3 1 4 2
3
10 2 7 2 7 4 4 1 5 6 7 3 1
36
For the first sample, one optimal plan is to answer questions on Day $1$ and Day $3$: