Chores

题意翻译

## 题目描述 Luba今天有$n$ 件家务要做。第$i$ 件家务要花费她的$a_i$ 时间在能完成。可以保证的是,对于每个$i∈[2,n]$ ,都有$a_i\geq a_{i-1}$ ,所以这个序列是有序的 Luba还能够在一些家务上特别努力。她可以选择不超过$k$ 件家务并使得完成这些家务只用$x$ 的时间,而不是$a_i$ ($x<\min_{i=1}^{n}a_i$ ) Luba是十分负责的,所以她必须做完所有的$n$ 件工作,现在她想知道她最少需要多少时间来做完全部这些家务。Luba不能同时做两件及以上的家务。 ### 输入格式: 第一行包含三个整数$n,k,x$ ($1\leq k\leq n\leq100,1\leq x\leq 99$ )— Luba需要做的家务的数量,它可以在$x$ 单位时间内做完的家务的数量,以及数字$x$ 本身。 第二行包含$n$ 个整数$a_i$ ($2\leq a_i\leq100$ )— Luba做第件家务所必需的时间 可以保证的有,$x<\min_{i=1}^{n}a_i$ 以及对于每个$i∈[2,n]$ ,都有$a_i\geq a_{i-1}$ , ### 输出格式: 输出一个数 — Luba 做完这$n$ 件家务所需的最少时间 ### 说明 在第一个样例中选择第三个和第四个家务的替换,所以答案是$3+6+2+2=13$ 第二个样例中可以任选两个家务替换,所以答案是$100*3+2*1=302$ Translated by Khassar

题目描述

Luba has to do $ n $ chores today. $ i $ -th chore takes $ a_{i} $ units of time to complete. It is guaranteed that for every ![](https://cdn.luogu.com.cn/upload/vjudge_pic/CF873A/38a605911fb9924209083130413ca634f60136f0.png) the condition $ a_{i}>=a_{i-1} $ is met, so the sequence is sorted. Also Luba can work really hard on some chores. She can choose not more than $ k $ any chores and do each of them in $ x $ units of time instead of $ a_{i} $ (![](https://cdn.luogu.com.cn/upload/vjudge_pic/CF873A/bbbd62b8322ce299a9b0c9272c3c84da875f0f49.png)). Luba is very responsible, so she has to do all $ n $ chores, and now she wants to know the minimum time she needs to do everything. Luba cannot do two chores simultaneously.

输入输出格式

输入格式


The first line contains three integers $ n,k,x (1<=k<=n<=100,1<=x<=99 $ ) — the number of chores Luba has to do, the number of chores she can do in $ x $ units of time, and the number $ x $ itself. The second line contains $ n $ integer numbers $ a_{i} (2<=a_{i}<=100) $ — the time Luba has to spend to do $ i $ -th chore. It is guaranteed that ![](https://cdn.luogu.com.cn/upload/vjudge_pic/CF873A/bbbd62b8322ce299a9b0c9272c3c84da875f0f49.png), and for each ![](https://cdn.luogu.com.cn/upload/vjudge_pic/CF873A/38a605911fb9924209083130413ca634f60136f0.png) $ a_{i}>=a_{i-1} $ .

输出格式


Print one number — minimum time Luba needs to do all $ n $ chores.

输入输出样例

输入样例 #1

4 2 2
3 6 7 10

输出样例 #1

13

输入样例 #2

5 2 1
100 100 100 100 100

输出样例 #2

302

说明

In the first example the best option would be to do the third and the fourth chore, spending $ x=2 $ time on each instead of $ a_{3} $ and $ a_{4} $ , respectively. Then the answer is $ 3+6+2+2=13 $ . In the second example Luba can choose any two chores to spend $ x $ time on them instead of $ a_{i} $ . So the answer is $ 100·3+2·1=302 $ .