Luba has to do n chores today. i-th chore takes a_{i} units of time to complete. It is guaranteed that for every $i \in [ 2 . . n ]$ 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} ($x < \operatorname{min}_{i = 1}^{n} a_{i}$).

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.


-----Input-----

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 $x < \operatorname{min}_{i = 1}^{n} a_{i}$, and for each $i \in [ 2 . . n ]$ a_{i} ≥ a_{i} - 1.


-----Output-----

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


-----Examples-----
Input
4 2 2
3 6 7 10

Output
13

Input
5 2 1
100 100 100 100 100

Output
302



-----Note-----

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.

Difficulty: EASY
Tags: Implementation

Starter code:

Solutions:
(n, k, x) = map(int, input().split())
l = list(map(int, input().split()))
l.reverse()
for i in range(k):
	l[i] = x
print(sum(l))


(n, k, x) = list(map(int, input().split()))
times = list(map(int, input().split()))
for i in range(n - 1, n - k - 1, -1):
	times[i] = x
print(sum(times))


s = [int(n) for n in input().split()]
z = [int(n) for n in input().split()]
for n in range(len(z) - s[1], s[0]):
	z[n] = s[2]
print(sum(z))


(n, k, x) = map(int, input().split())
A = list(map(int, input().split()))
x = sum(A[:-k]) + x * k
print(x)


def inp(s, i):
	k = 0
	it = ''
	s = ' ' + s
	for j in s:
		if j == ' ':
			k += 1
		if k == i and (not j == ' '):
			it += j
	return it
s = input()
n = int(inp(s, 1))
k = int(inp(s, 2))
x = int(inp(s, 3))
s = input()
a = list()
for q in range(n):
	p = int(inp(s, q + 1))
	a.append(p)
m = 101
t = 0
a.sort()
a.reverse()
c = 0
for i in a:
	c += 1
	if c <= k:
		t += x
	else:
		t += i
print(t)


(n, k, x) = map(int, input().split(' '))
m = list(map(int, input().split(' ')))
e = 0
for i in range(n):
	e += m[i]
for i in range(k):
	j = n - 1 - i
	if m[j] > x:
		e = e - m[j] + x
print(e)


alph = 'abcdefghijklmnopqrstuvwxyz'
(n, k, x) = map(int, input().split())
a = list(map(int, input().split()))
E = sum(a)
for i in range(min(n, k)):
	E -= a[-i - 1] - x
print(E)


(n, k, x) = map(int, input().split())
L = list(map(int, input().split()))
if n == 1:
	print(x)
elif n == k:
	print(x * k)
else:
	L = sorted(L)
	for i in range(k):
		L.pop(len(L) - 1)
	s = x * k
	for i in range(len(L)):
		s += L[i]
	print(s)


(n, k, x) = map(int, input().split())
a = [int(i) for i in input().split()]
result = k * x + sum(a[:n - k])
print(result)


l = list(map(int, input().split()))
n = l[0]
k = l[1]
x = l[2]
Flag = 0
scores = list(map(int, input().split()))
scores = sorted(scores, reverse=True)
while k > 0:
	scores[Flag] = x
	k -= 1
	Flag += 1
print(sum(scores))


def numline(f=int):
	return map(f, input().split())
(n, k, x) = numline()
a = [i for i in numline()]
print(sum(a[:len(a) - k]) + k * x)


(n, k, x) = map(int, input().split())
a = input().split()
n = len(a)
ans = 0
for i in range(n):
	if i + k < n:
		ans += int(a[i])
	else:
		ans += x
print(ans)


(n, k, x) = map(int, input().split())
a = list(map(int, input().split()))
print(sum(a) - sum(a[-k:]) + k * x)


import re
import sys
import math
import itertools
import collections

def inputArray(TYPE=int):
	return [TYPE(x) for x in input().split()]

def solve():
	(n, k, x) = inputArray()
	arr = inputArray()
	print(sum(itertools.islice(arr, 0, n - k)) + k * x)
solve()


(n, k, x) = tuple(map(int, input().split()))
a = list(map(int, input().split()))
for i in range(n - k, n):
	a[i] = x
print(sum(a))


(n, k, x) = map(int, input().split())
a = list(map(int, input().split()))
c = 0
su = sum(a)
for i in range(n - 1, n - k - 1, -1):
	su -= a[i]
print(su + k * x)


(n, special, t) = map(int, input().split())
chores = sorted(list(map(int, input().split())), reverse=True)
total = 0
for ch in chores:
	if special > 0 and t < ch:
		special -= 1
		total += t
	else:
		total += ch
print(total)


(n, k, x) = [int(k) for k in input().split()]
time_na_deli = [int(k) for k in input().split()]
time_na = 0
for deli in range(n):
	ost_vremya = n - deli
	if ost_vremya <= k and x < time_na_deli[deli]:
		time_na += x
	else:
		time_na += time_na_deli[deli]
print(time_na)


(n, k, x) = map(int, input().split())
tempo = list(map(int, input().split()))
tempo.sort()
soma = sum(tempo[:n - k])
ans = k * x + soma
print(ans)


(n, k, x) = list(map(int, input().split()))
numbers = list(map(int, input().split()))
s = 0
s += k * x
for i in range(len(numbers) - k):
	s += numbers[i]
print(s)


def solution(l1, l2):
	l2.reverse()
	ans = 0
	for x in l2:
		if x > l1[2] and l1[1] != 0:
			ans += l1[2]
			l1[1] -= 1
		else:
			ans += x
	return ans

def answer():
	l1 = [int(x) for x in input().split()]
	l2 = [int(x) for x in input().split()]
	print(solution(l1, l2))
answer()


inp = input()
inp = inp.split()
n = int(inp[0])
k = int(inp[1])
x = int(inp[2])
chores = input().split()
ans = 0
for i in range(n):
	a = int(chores[i])
	if i < n - k:
		ans += a
	else:
		ans += x
print(ans)


bb = input().split()
n1 = int(bb[0])
n2 = int(bb[1])
n3 = int(bb[2])
nu = input().split()
v = 0
for r in range(n1 - n2):
	v = v + int(nu[r])
v = v + n2 * n3
print(v)


I = lambda : map(int, input().split())
(_, k, x) = I()
print(sum(list(I())[:-k]) + k * x)


(N, K, X) = map(int, input().split())
L = list(map(int, input().split()))
last = N - 1
while K:
	L[last] = X
	last -= 1
	K -= 1
ans = 0
for i in range(N):
	ans += L[i]
print(ans)


(n, k, x) = map(int, input().split())
a = list(map(int, input().split()))[:n]
s = 0
for i in range(0, n - k):
	s += a[i]
s += k * x
print(s)


(n, k, m) = map(int, input().split())
a = sorted(list(map(int, input().split())))
print(k * m + sum(a[:n - k]))


(a, b, c) = map(int, input().split())
l = list(map(int, input().split()))
print(sum(l[:a - b]) + b * c)


(n, k, x) = list(map(int, input().strip().split()))
l = list(map(int, input().strip().split()))
l.sort(reverse=True)
t = l[k:]
p = sum(t)
print(p + k * x)


(n, k, x) = map(int, input().split())
print(sum([*map(int, input().split())][:n - k]) + (n - (n - k)) * x)


def answer(chores, n, k, x):
	total = 0
	for _ in range(n - k):
		total += next(chores)
	for _ in range(k):
		total += x
	return total
(n, k, x) = map(int, input().split(' '))
chores = map(int, input().split(' '))
print(answer(chores, n, k, x))


(n, k, x) = map(int, input().split())
l = list(map(int, input().split()))
print(sum(l[:-k]) + k * x)


(n, c, t) = map(int, input().split())
l = list(map(int, input().split()))
s = 0
for i in range(n - c):
	z = min(l)
	s += z
	l.remove(z)
print(s + t * c)


(n, k, x) = list(map(int, input().split()))
a = list(map(int, input().split()))
ans = 0
for i in range(n):
	if n - i - 1 < k:
		ans += min(a[i], x)
	else:
		ans += a[i]
print(ans)


(n, k, x) = map(int, input().split())
mas = list(map(int, input().split()))
print(k * x + sum(mas[:-k]))


(n, k, x) = [int(x) for x in input().split()]
nums = [int(x) for x in input().split()]
partial_sum = 0
for i in range(n - k):
	partial_sum += nums[i]
print(partial_sum + k * x)


[n, k, m] = [int(x) for x in input().split()]
ai = [int(x) for x in input().split()]
sum = 0
for x in range(0, n - k):
	sum = sum + ai[x]
sum = sum + k * m
print(sum)


a = tuple(map(int, input().split()))
b = tuple(map(int, input().split()))
print(sum(b[:a[0] - a[1]]) + a[1] * a[2])


(n, k, x) = map(int, input().split())
e = list(map(int, input().split()))
e.sort(reverse=True)
q = 0
for i in range(0, k):
	e[i] = x
for i in range(0, len(e)):
	q += e[i]
print(q)


class CodeforcesTask873ASolution:

	def __init__(self):
		self.result = ''
		self.n_k_x = []
		self.chores = []

	def read_input(self):
		self.n_k_x = [int(x) for x in input().split(' ')]
		self.chores = [int(x) for x in input().split(' ')][::-1]

	def process_task(self):
		for x in range(self.n_k_x[1]):
			self.chores[x] = min(self.chores[x], self.n_k_x[2])
		self.result = str(sum(self.chores))

	def get_result(self):
		return self.result
Solution = CodeforcesTask873ASolution()
Solution.read_input()
Solution.process_task()
print(Solution.get_result())


def solve(n, k, x, a):
	return k * x + sum(a[:-k])

def main():
	(n, k, x) = list(map(int, input().split()))
	a = list(map(int, input().split()))
	print(solve(n, k, x, a))
main()


n = [int(x) for x in input().split()]
k = [int(x) for x in input().split()]
k.sort()
s = 0
for i in range(0, n[0]):
	if n[0] - i > n[1]:
		s += k[i]
	else:
		s += min(k[i], n[2])
print(s)


baris = input()
string = baris.split(' ')
n = int(string[0])
k = int(string[1])
x = int(string[2])
baris = input()
string = baris.split(' ')
angkaSekarang = []
for i in range(0, n):
	angkaSekarang.append(int(string[i]))
angkaSekarang.sort()
hasil = 0
for i in range(0, n - k):
	hasil = hasil + angkaSekarang[i]
for i in range(0, k):
	hasil = hasil + x
print(hasil)


(x, y, z) = map(int, input().split(' '))
arr = list(map(int, input().split()))
arr.sort()
ind = -1
for i in range(0, y):
	del arr[ind]
res = sum(arr) + y * z
print(res)


(n, k, x) = list(map(int, input().split()))
a = list(map(int, input().split()))
for i in range(len(a) - 1, len(a) - 1 - k, -1):
	a[i] = x
print(sum(a))


import sys

def main():
	(n, k, x) = map(int, input().split())
	ar = list(map(int, input().split()))
	print(k * x + sum(ar[:n - k]))
main()


(n, k, x) = [int(x) for x in input().split(' ')]
l = [int(x) for x in input().split(' ')]
l = l[::-1]
for i in range(k):
	l[i] = x
print(sum(l))


[n, k, x] = list(map(int, input().split()))
a = list(map(int, input().split()))
a.sort(reverse=True)
res = 0
for i in range(n):
	if i < k:
		res += x
	else:
		res += a[i]
print(res)


(n, k, x) = map(int, input().split())
l = [int(x) for x in input().split()]
print(sum(l[:-k]) + x * k)


(n, k, x) = map(int, input().split())
a = list(map(int, input().split()))
flag = 0
if len(a) == 1:
	flag = 1
	print(x)
else:
	while len(a) != n - k:
		p = max(a)
		a.remove(p)
if flag == 0:
	l = [x] * k
	a.extend(l)
	print(sum(a))


l1 = [int(i) for i in input().split()]
a = input().split()
a = [int(a[i]) for i in range(len(a))]
print(sum(a[0:l1[0] - l1[1]]) + l1[1] * l1[2])


(n, x, y) = list(map(int, input().rstrip().split()))
k = list(map(int, input().rstrip().split()))
sum = 0
for i in range(n - x):
	sum = sum + k[i]
sum = sum + x * y
print(sum)


i = lambda : map(int, input().split())
(n, k, x) = i()
a = sorted(i())[::-1]
print(k * x + sum(a[k:]))


(n, k, x) = input().split()
time = [int(x) for x in input().split()]
total_time = 0
for i in range(int(n) - int(k)):
	total_time += time[i]
total_time = total_time + int(k) * int(x)
print(total_time)


import sys

def get_inputs():
	data = []
	for line in sys.stdin:
		data.append([int(i) for i in line.split()])
	return (data[0][0], data[0][1], data[0][2], data[1])
(n, k, x, a) = get_inputs()
for i in range(k):
	a[-(i + 1)] = x
print(sum(a))


inp = input().split()
inp = [int(i) for i in inp]
ai = input().split()
ai = sorted([int(i) for i in ai])
index = -1
for i in range(inp[1]):
	ai[index] = inp[2]
	index = index - 1
print(sum(ai))


(n, k, x) = map(int, input().split())
arr = [int(x) for x in input().split()]
print(sum(arr[:-1 * k]) + k * x)


import math
from fractions import Fraction as frac
MOD = 1000000000.0 + 7

def solve(case_no):
	(n, k, x) = map(int, input().split())
	a = list(map(int, input().split()))
	ans = k * x
	for i in range(n - 1 - k, -1, -1):
		ans += a[i]
	print(ans)
t = 1
for i in range(1, t + 1):
	solve(i)


(n, k, x) = map(int, input().split())
Range = n - k
Sum = 0
a = list(map(int, input().split()))
for i in range(Range):
	Sum += a[i]
Sum += k * x
print(Sum)


def answer(chores, n, k, x):
	total = 0
	for i in range(n - k):
		total += chores[i]
	total += k * x
	return total
(n, k, x) = map(int, input().split(' '))
chores = list(map(int, input().split(' ')))
print(answer(chores, n, k, x))


(n, k, x) = map(int, input().split())
time = list(map(int, input().split()))
sum = 0
for i in range(n - k):
	sum = time[i] + sum
total = sum + k * x
print(total)


(n, k, x) = map(int, input().split())
chores_time = list(map(int, input().split()))
addon = k * x
time_taken = 0
for i in range(n - k):
	time_taken += chores_time[i]
print(time_taken + addon)


def main_function():
	(n, k, x) = [int(i) for i in input().split(' ')]
	a = [int(i) for i in input().split(' ')]
	time = 0
	for i in range(len(a)):
		if i >= len(a) - k:
			time += x
		else:
			time += a[i]
	return time
print(main_function())


input1 = input('').split(' ')
chores = [int(num) for num in input('').split(' ')]
numChores = int(input1[0])
numWorkHard = int(input1[1])
workHardTime = int(input1[2])
for i in range(len(chores), 0, -1):
	if numWorkHard > 0:
		chores[i - 1] = workHardTime
		numWorkHard -= 1
	else:
		i = 0
print(sum(chores))


(n, k, x) = map(int, input().split())
a = [int(b) for b in input().split()]
for i in range(k):
	a.pop()
for i in range(k):
	a.append(x)
print(sum(a))


(n, k, x) = [int(y) for y in input().split()]
li = [int(y) for y in input().split()]
print(k * x + sum(li[:n - k]))


(n, k, x) = map(int, input().split())
ai = [int(i) for i in input().split()]
for i in range(k):
	ai[-i - 1] = x
print(sum(ai))


import sys
import math
get_string = lambda : sys.stdin.readline().strip()
get_int_list = lambda : list(map(int, sys.stdin.readline().strip().split()))
get_intList_from_str = lambda : list(map(int, list(sys.stdin.readline().strip())))
get_charList_from_str = lambda : list(sys.stdin.readline().strip())
get_char_list = lambda : sys.stdin.readline().strip().split()
get_int = lambda : int(sys.stdin.readline())
pt = lambda x: sys.stdout.write(str(x))
(n, k, x) = get_int_list()
lst = sorted(get_int_list())
for i in range(k):
	lst[~i] = x
print(sum(lst))


(n, k, x) = (int(i) for i in input().split(' '))
lst = [int(j) for j in input().split(' ')]
print(sum(lst[:n - k]) + k * x)


(n, h, x) = map(int, input().split())
l = list(map(int, input().split()))
l.sort(reverse=True)
if h > n:
	h = n
print(h * x + sum(l[h:]))


def main():
	[n, k, x] = [int(_) for _ in input().split()]
	t = [int(_) for _ in input().split()]
	t = t[::-1]
	for i in range(k):
		t[i] = x
	print(sum(t))
main()


R = lambda : map(int, input().split())
(n, k, x) = R()
a = list(R())
print(sum(a[:n - k]) + k * x)


(n, k, x) = map(int, input().split())
a = [int(c) for c in input().split()]
for i in range(k):
	if max(a) >= x:
		a.remove(max(a))
		a.append(x)
res = 0
for i in a:
	res += i
print(res)


line1 = input().split()
line2 = input().split()
(n, k, x) = (int(line1[0]), int(line1[1]), int(line1[2]))
sum = 0
for i in range(n - k):
	sum += int(line2[i])
print(sum + k * x)


import sys
(n, k, x) = map(int, input().split())
a = sorted(map(int, input().split()), reverse=True)
for i in range(k):
	a[i] = min(a[i], x)
print(sum(a))


I = lambda : int(input())
IL = lambda : list(map(int, input().split()))
(n, k, x) = IL()
A = IL()[::-1]
for i in range(k):
	A[i] = x
print(sum(A))


n = input()
n = n.split()
(n, k, x) = (int(n[0]), int(n[1]), int(n[2]))
a = input()
a = [int(x) for x in a.split()]
res = 0
for i in range(n):
	if i < n - k:
		res += a[i]
	else:
		res += x
print(res)


tmp = list(map(int, input().split()))
(n, k, x) = (tmp[0], tmp[1], tmp[2])
a = list(map(int, input().split()))
k1 = 0
for i in range(n - 1, -1, -1):
	if k1 < k:
		a[i] = x
		k1 += 1
	else:
		break
print(sum(a))


my_input = input()
(n, k, x) = my_input.split()
my_chores = input()
my_list = my_chores.split()
for y in range(len(my_list)):
	my_list[y] = int(my_list[y])
my_list.sort(reverse=True)
for i in range(int(k)):
	my_list[i] = int(x)
print(sum(my_list))


n = input()
n = n.split()
k = int(n[1])
x = int(n[2])
n = int(n[0])
a = input()
a = a.split()
c = n - 1
ans = 0
for i in range(n):
	a[i] = int(a[i])
while k > 0:
	ans += x
	c -= 1
	k -= 1
while c >= 0:
	ans += a[c]
	c -= 1
print(ans)


R = lambda : map(int, input().split())
(n, k, x) = R()
a = list(R())
a.sort(reverse=True)
ans = 0
for i in range(n):
	if k > 0:
		ans += x
		k -= 1
	else:
		ans += a[i]
print(ans)


(n, k, x) = map(int, input().split())
a = sorted(list(map(int, input().split())))
result = k * x
for i in range(n - k):
	result += a[i]
print(result)


(n, k, x) = [int(x) for x in input().split()]
t = [int(x) for x in input().split()]
L = len(t)
kk = min(L, k)
res = sum(t[:L - kk]) + kk * x
print(res)


(n, m, k) = [int(x) for x in input().split()]
L = [int(x) for x in input().split()]
for j in range(m):
	L[n - j - 1] = k
print(sum(L))


def main():
	(n, k, x) = list(map(int, input().split()))
	a = list(map(int, input().split()))
	if n == 1:
		print(x)
	else:
		print(sum(a[:-k]) + k * x)
main()


(num_chores, num_x_chores, x) = [int(string) for string in input().split()]
chore_times = [int(string) for string in input().split()]
total = 0
for chore in reversed(chore_times):
	if chore > x and num_x_chores > 0:
		total += x
		num_x_chores -= 1
	else:
		total += chore
print(total)


n = [int(i) for i in input().split()]
a = [int(i) for i in input().split()]
sum = 0
for i in range(n[1]):
	sum += n[2]
for i in a[:-n[1]]:
	sum += i
print(sum)


def main():
	buff = input().split()
	(n, k, x) = (int(buff[0]), int(buff[1]), int(buff[2]))
	arr = list(map(int, input().split()))
	res = 0
	for y in arr[:-k]:
		res += y
	res += k * x
	print('{}'.format(res))
main()


(n, m, o) = map(int, input().split())
b = list(map(int, input().split()))
for i in range(m):
	b.pop()
print(sum(b) + m * o)


class Work:

	def __init__(self, usedTime: int, _id: int):
		self.usedTime = usedTime
		self.id = _id

	def __lt__(self, other):
		if type(other) != Work:
			return
		return self.usedTime < other.usedTime

def main() -> None:
	(n, k, x) = map(int, str(input()).split())
	_3longestWorks = []
	a = list(map(int, str(input()).split()))
	for i in range(n):
		if len(_3longestWorks) < k or _3longestWorks[0].usedTime < a[i]:
			_3longestWorks.append(Work(a[i], i))
			_3longestWorks.sort()
			if len(_3longestWorks) > k:
				del _3longestWorks[0]
	for longestWork in _3longestWorks:
		a[longestWork.id] = x
	result = 0
	for time in a:
		result += time
	print(result)
main()


(n, k, x) = list(map(int, input().split()))
l = list(map(int, input().split()))
s = 0
if l[-1] > x:
	for i in range(n - k):
		s = s + l[i]
	s = s + k * x
	print(s)
else:
	print(sum(l))


(n, k, x) = map(int, input().split())
t = list(map(int, input().split()))
res = 0
for i in range(n):
	if i < n - k:
		res += t[i]
	else:
		res += min(t[i], x)
print(res)


(n, k, x) = map(int, input().split())
A = list(map(int, input().split()))
A.sort(reverse=True)
ans = sum(A) - sum(A[0:k]) + k * x
print(ans)


(a, b, c) = map(int, input().split())
d = list(map(int, input().split()))
d.reverse()
s = 0
for i in range(b):
	d[i] = c
for i in d:
	s += i
print(s)


f = lambda : map(int, input().split())
(n, k, x) = f()
print(sum(list(f())[:n - k]) + k * x)


y = input().split()
n = int(y[0])
k = int(y[1])
x = int(y[2])
a = []
s = 0
a = input().split()
for i in range(len(a) - k):
	s += int(a[i])
s += k * x
print(s)


(n, k, x) = [int(x) for x in input().split()]
a = [int(x) for x in input().split()]
sum = 0
for i in range(len(a) - k):
	sum = sum + a[i]
print(sum + k * x)


(n, k, x) = map(int, input().split())
l = []
l = [int(x) for x in input().split()]
l.sort(reverse=True)
s = 0
for i in range(k):
	s += x
	l.pop(0)
for i in l:
	s += i
print(s)


(n, k, x) = map(int, input().split())
l = list(map(int, input().split()))
c = n - k
s = 0
for i in range(c):
	s = s + l[i]
print(s + k * x)


import math, itertools, fractions, heapq, collections, bisect, sys, queue, copy
sys.setrecursionlimit(10 ** 7)
inf = 10 ** 20
mod = 10 ** 9 + 7
dd = [(-1, 0), (0, 1), (1, 0), (0, -1)]
ddn = [(-1, 0), (-1, 1), (0, 1), (1, 1), (1, 0), (1, -1), (0, -1), (-1, -1)]

def LI():
	return [int(x) for x in sys.stdin.readline().split()]

def I():
	return int(sys.stdin.readline())

def F():
	return float(sys.stdin.readline())

def LS():
	return sys.stdin.readline().split()

def S():
	return input()

def main():
	(n, k, x) = LI()
	l = LI()
	l.sort(reverse=True)
	ans = 0
	for y in l:
		if k > 0 and x < y:
			ans += x
			k -= 1
		else:
			ans += y
	return ans
print(main())


(n, k, x) = list(map(int, input().split()))
t = list(map(int, input().split()))
e = k * x
d = sum(t[:n - k])
print(e + d)


import sys
import math
import bisect
import itertools

def main():
	(n, k, x) = map(int, input().split())
	A = list(map(int, input().split()))
	for i in range(n - k, n):
		A[i] = x
	print(sum(A))
main()


(n, m, k) = map(int, input().split())
T = list(map(int, input().split()))
total = 0
for i in range(n - m):
	total += T[i]
total += k * m
print(total)


(a, b, c) = [int(x) for x in input().split()]
tasks = [int(x) for x in input().split()]
print(sum(tasks[:len(tasks) - b]) + b * c)


(a, b, c) = map(int, input().split())
x = list(map(int, input().split()))
t = 0
x.sort()
for i in range(b):
	t += c
x = x[0:a - b]
print(t + sum(x))


(N, K, X) = list(map(int, input().split()))
arr = list(map(int, input().split()))
res = sum(arr[0:-K])
res += X * K
print(res)


(n, k, x) = map(int, input().split())
Time = list(map(int, input().split()))
rez = sum(Time[0:n - k]) + k * x
print(rez)


import io, os
input = io.BytesIO(os.read(0, os.fstat(0).st_size)).readline
(n, k, x) = map(int, input().split())
l = [int(x) for x in input().split()]
ans = 0
for i in range(n - k):
	ans += l[i]
for i in range(k):
	ans += x
print(ans)


(n, k, x) = map(int, input().split())
a = list(map(int, input().split()))
for i in range(k):
	a.pop()
	a.append(x)
	a.sort()
print(sum(a))


(n, k, s) = map(int, input().split())
a = list(map(int, input().split()))
j = len(a) - 1
while k > 0:
	if k < 0:
		break
	a[j] = s
	j -= 1
	k -= 1
print(sum(a))


def solve():
	(n, a, b) = list(map(int, input().split()))
	l = list(map(int, input().split()))
	l.sort(reverse=True)
	x = a * b
	for i in range(a, n):
		x += l[i]
	print(x)
solve()


def dela(lst, k, x):
	result = x * k
	for i in range(len(lst) - k):
		result += lst[i]
	return result
(N, K, X) = [int(j) for j in input().split()]
a = [int(z) for z in input().split()]
print(dela(a, K, X))


n = input()
xx = n.split()
y = input()
yy = y.split()
su = 0
for i in range(0, int(xx[0]) - int(xx[1])):
	su += int(yy[i])
su += int(xx[1]) * int(xx[2])
print(su)


(n, k, x) = map(int, input().split())
arr = list(map(int, input().split()))
arr.sort()
print(sum(arr[:-k]) + x * k)


(a, b, c) = map(int, input().split())
print(sum(map(int, input().split()[:a - b])) + b * c)


(n, k, x) = map(int, input().split())
a = list(map(int, input().split()))

def t():
	for i in range(0, len(a), -1):
		if x > a[i]:
			return k - len(a) - i
	return k
print(t() * x + sum(a[:n - t()]))


(n, k, x) = map(int, input().split())
a = [int(x) for x in input().split()]
res = k * x
n -= k
res += sum(a[:n])
print(res)


(n, k, x) = map(int, input().split())
s = list(map(int, input().split()))
print(sum(s[:-k]) + k * x)


given = input().split(' ')
tasks = input().split(' ')
nominal = 0
for i in range(len(tasks) - int(given[1])):
	nominal += int(tasks[i])
total = nominal + int(given[1]) * int(given[2])
print(total)


(x, y, z) = map(int, input().split())
a = list(map(int, input().split()))
print(sum(a[:x - y]) + y * z)


(n, k, x) = map(int, input().split())
a = list(map(int, input().split()))
a.sort(reverse=True)
for i in range(0, k):
	a[i] = x
print(sum(a))


line = input().split()
n = int(line[0])
k = int(line[1])
x = int(line[2])
line = input().split()
a = [int(i) for i in line]
for i in range(k):
	a[-(i + 1)] = x
print(sum(a))


read = lambda : map(int, input().split())
(n, k, x) = read()
a = list(read())
a.reverse()
ans = 0
for i in range(n):
	if k > 0 and a[i] > x:
		ans += x
		k -= 1
	else:
		ans += a[i]
print(ans)


(n, k, x) = list(map(int, input().split()))
t = list(map(int, input().split()))
print(sum(t[:-k]) + k * x)


(n, k, x) = [int(i) for i in input().split()]
a = [int(i) for i in input().split()]
l = []
sum = 0
for i in range(0, len(a)):
	if a[i] <= x:
		sum = sum + a[i]
	else:
		l.append(a[i])
l = sorted(l, reverse=True)
for i in range(0, len(l)):
	if k > 0:
		k = k - 1
		sum = sum + x
	else:
		sum = sum + l[i]
print(sum)


(n, k, x) = map(int, input().split())
a = list(map(int, input().split()))
i = n - 1
c = 0
while i >= 0:
	if a[i] > x:
		a[i] = x
		c = c + 1
	if c == k:
		break
	i = i - 1
print(sum(a))


b = list(map(int, input().split()))[:3]
a = list(map(int, input().split()))[:b[0]]
s = 0
for i in range(0, b[0] - b[1]):
	s += a[i]
s += b[1] * b[2]
print(s)


(n, k, x) = [int(x) for x in input().split()]
chores = [int(x) for x in input().split()]
times = sum(chores[:n - k]) + k * x
print(times)


arr = list(map(int, input().split()))
a = list(map(int, input().split()))
answ = arr[1] * arr[2]
for i in range(arr[0] - arr[1]):
	answ = answ + a[i]
print(answ)


from sys import stdin

def main():
	(n, k, x) = [int(tok) for tok in stdin.readline().strip().split()]
	a = [int(tok) for tok in stdin.readline().strip().split()]
	print(sum(a[:n - k]) + x * k)
main()


line1 = input().split()
(n, k, x) = (int(line1[0]), int(line1[1]), int(line1[2]))
suma = [int(i) for i in input().split()]
print(sum(suma[:len(suma) - k]) + x * k)


(n, k, x) = list(map(int, input().split()))
a = list(map(int, input().split()))
for i in range(k):
	if a[n - 1 - i] > x:
		a[n - 1 - i] = x
	else:
		break
print(sum(a))


a = input().split()
b = input().split()
c = 0
for i in range(len(b) - int(a[1])):
	c += int(b[i])
c += int(a[1]) * int(a[2])
print(c)


(n, k, x) = input().split()
a = input().split()
n = int(n)
k = int(k)
x = int(x)
times = []
for el in a:
	el = int(el)
	times.append(el)

def count_total_time(times, k, n, x):
	if k > n:
		return n * x
	total_time = 0
	for time in times[:len(times) - k]:
		total_time += time
	return total_time + k * x
answer = count_total_time(times, k, n, x)
print(answer)


(n, k, x) = map(int, input().split())
a = list(map(int, input().split()))
a.sort(reverse=True)
c = sum(a[k:]) + k * x
print(c)


(n, k, x) = map(int, input().split())
l = list(map(int, input().split()))
ans = 0
i = n - 1
while k > 0:
	ans += x
	l.remove(l[i])
	k -= 1
	i -= 1
print(ans + sum(l))


(n, k, x) = [int(z) for z in input().split()]
dela = [int(z) for z in input().split()]
ans = 0
for i in range(n - k):
	ans += dela[i]
ans += x * k
print(ans)


(n, k, x) = [int(i) for i in input().split()]
ans = 0
l = [int(i) for i in input().split()]
for i in range(1, n + 1):
	if i <= n - k:
		ans += l[i - 1]
ans += x * k
print(ans)


import heapq
(n, k, x) = map(int, input().split())
chores = list(map(int, input().split()))
chores.sort()
chores = chores[:n - k]
sec = heapq.nlargest(k, chores)
tot = k * x + sum(chores)
print(tot)


(n, k, x) = map(int, input().split())
a = list(map(int, input().split()))
for i in range(n)[::-1]:
	if a[i] > x and k > 0:
		a[i] = x
		k -= 1
print(sum(a))


(x, y, z) = list(map(int, input().split()))
p = list(map(int, input().split()))
print(sum(p[0:x - y]) + y * z)


import math
n = [int(i) for i in input().split()]
a = [int(i) for i in input().split()]
sum1 = min(n[1], n[0]) * n[2]
for i in range(0, max(0, n[0] - n[1])):
	sum1 += a[i]
print(sum1)


(n, k, x) = map(int, input().split())
a = sorted(list(map(int, input().split())))
n -= k
s = sum(a[0:n]) + k * x
print(s)


(n, k, x) = input().split()
n = int(n)
k = int(k)
x = int(x)
chores = [int(c) for c in input().split()]
time = 0
for i in range(n - k):
	time += chores[i]
time += k * x
print(time)


(n, k, x) = map(int, input().split())
y = [int(y) for y in input().split()]
print(sum(y[:len(y) - k]) + k * x)


(n, k, x) = map(int, input().strip().split())
a = list(map(int, input().strip().split()))
result = sum(a[:len(a) - k])
result += sum((b if b < x else x for b in a[:k]))
print(result)


(n, k, x) = map(int, input().split())
a = k * x
b = n - k
c = 0
li = list(map(int, input().split()))
for i in range(b):
	c += li[i]
c += a
print(c)


(n, k, x) = [int(x) for x in input().split(' ')]
a = [int(x) for x in input().split(' ')]
a = a[:-k] + [min(a[-i], x) for i in range(1, k + 1)]
print(sum(a))


(n, k, x) = map(int, input().split())
l = list(map(int, input().split()))
su = 0
for i in range(n - k):
	su += l[i]
print(su + k * x)


(x, y, z) = map(int, input().split())
list = [int(i) for i in input().split()]
list.sort()
d = x - y
n = 0
for i in range(d):
	n += list[i]
print(n + y * z)


(n, k, x) = map(int, input().split())
c = list(map(int, input().split()))
ans = k * x
for i in range(0, n - k):
	ans += c[i]
print(ans)


(n, k, x) = list(map(int, input().split()))
a = list(map(int, input().split()))
s = sum(a)
i = n - 1
while i > -1 and a[i] > x and (k > 0):
	k -= 1
	s -= a[i]
	s += x
	i -= 1
print(s)


(n, k, x) = map(int, input().split())
a = [int(i) for i in input().split()]
a.sort(reverse=True)
time = 0
for i in range(n):
	if k > 0 and a[i] > x:
		time += x
		k -= 1
	else:
		time += a[i]
print(time)


from bisect import bisect_right as br
(N, K, X) = [int(c) for c in input().split()]
A = [int(c) for c in input().split()]
x_slower = br(A, X)
ans = sum((A[i] for i in range(x_slower)))
k = 0
for i in range(N - 1, x_slower - 1, -1):
	if k < K:
		ans += X
		k += 1
	else:
		ans += A[i]
print(ans)


def main():
	(n, k, x) = map(int, input().split())
	chores = list(map(int, input().split()))
	chores.reverse()
	ans = 0
	for i in range(k):
		ans += x
		chores.pop(0)
	ans += sum(chores)
	print(ans)
main()


(n, k, x) = map(int, input().split())
a = list(map(int, input().split()))
temp = k
if len(a) <= 2:
	print(k * x)
else:
	while k > 0:
		a.remove(max(a))
		k = k - 1
	print(sum(a) + temp * x)


l = list(map(int, input().split()))
n = l[0]
k = l[1]
x = l[2]
sn = list(map(int, input().split()))
sum = 0
for i in range(0, n - k):
	sum = sum + sn[i]
for j in range(n - k, n):
	sum = sum + x
print(sum)


read = lambda : tuple(map(int, input().split()))
(n, k, x) = read()
l = list(read())
for i in range(k):
	l[-i - 1] = x
print(sum(l))


while True:
	try:
		(n, k, x) = map(int, input().split())
		arr = []
		for i in input().split():
			arr.append(int(i))
		if k >= n:
			print(n * x)
		else:
			ans = int(0)
			ans += k * x
			for i in range(0, n - k):
				ans += arr[i]
			print(ans)
	except:
		break


(a, b, d) = input().split()
c = list(map(int, input().split()))
c.sort()
r = 0
while r < int(b):
	c.pop()
	r = r + 1
print(sum(c) + int(b) * int(d))


(n, k, x) = [int(i) for i in input().split()]
a = [int(i) for i in input().split()]
ans = 0
for i in range(n - k):
	ans += a[i]
ans += x * k
print(ans)


(n, k, x) = input().split()
a = input().split()
n = int(n)
k = int(k)
x = int(x)
helper = 0
helper_2 = 0
massiv = []
for el in a:
	if el != ' ':
		el = int(el)
		massiv.append(el)
while k > 0:
	helper -= 1
	massiv[helper] = x
	k -= 1
for el in massiv:
	helper_2 += el
print(helper_2)


from sys import stdin, stdout
from os import path
if path.exists('input.txt'):
	stdin = open('input.txt', 'r')
	stdout = open('output.txt', 'w')

	def I():
		return int(input())

	def In():
		return map(int, input().split())
else:

	def I():
		return int(stdin.readline())

	def In():
		return map(int, stdin.readline().split())

	def S():
		return stdin.readline().rstrip()

	def Sn():
		return stdin.readline().split(' ')

def Out(whatever):
	return stdout.write(whatever)
(n, k, x) = In()
arr = list(In())
ans = sum(arr[:n - k]) + x * k
Out(str(ans))


(n, k, x) = map(int, input().split())
a = list(map(int, input().split()))
answer = 0
while x < max(a) and k > 0 and (len(a) != 0):
	answer += x
	k -= 1
	a.pop(a.index(max(a)))
	if len(a) == 0:
		break
answer += sum(a)
print(answer)


(n, k, x) = input().split(' ')
n = int(n)
k = int(k)
x = int(x)
b = list(input().split(' '))
b = [int(i) for i in b]
for i in range(1, k + 1):
	b[-i] = x
print(sum(b))


(n, k, x) = list(map(int, input().split()))
a = list(map(int, input().split()))
a.sort()
a.reverse()
br = 0
for i in range(n):
	if i + 1 <= k:
		br = br + x
	else:
		br = br + a[i]
print(br)


(n, k, x) = list(map(int, input().split()))
l = sorted(list(map(int, input().split())))
a = sum(l[:n - k]) + k * x
print(a)


(n, k, x) = map(int, input().split())
a = list(map(int, input().split()))
i = n - 1
q = 0
while q != k:
	a[i] = x
	i -= 1
	q += 1
print(sum(a))


(a, b, c) = map(int, input().split())
sum = b * c
arr = list(map(int, input().split()))
for i in range(0, len(arr) - b):
	sum = sum + arr[i]
print(sum)


(n, k, x) = map(int, input().split())
a = [int(x) for x in input().split()]
tm = 0
for i in range(0, n - k):
	tm += a[i]
while k != 0:
	tm += x
	k -= 1
print(tm)


(n, k, x) = map(int, input().split())
a = sorted(list(map(int, input().split())), reverse=True)
print(sum(a[k:]) + x * k)


(n, k, x) = map(int, input().split())
data = list(map(int, input().split()))[::-1]
print(sum((min(v, x) if index < k else v for (index, v) in enumerate(data))))


import sys, math, queue, bisect
MOD = 10 ** 9 + 7
sys.setrecursionlimit(1000000)
(n, k, x) = map(int, input().split())
a = list(map(int, input().split()))
print(sum(a[:-k]) + k * x)


(n, k, x) = [int(x) for x in input().split()]
a = [int(x) for x in input().split()]
a.sort(reverse=True)
t = len(a[:k]) * x
t += sum(a[k:])
print(t)


(a, b, c) = map(int, input().split())
a1 = list(map(int, input().split()))
print(sum(a1[0:a - b]) + b * c)


time = []
(n, a, b) = map(int, input().split())
time = list(map(int, input().split()))
cnt = n - a
sum = 0
while cnt > 0:
	cnt -= 1
	sum += time[cnt]
sum += a * b
print(sum)


def minTime(n, k, x, choreArray):
	choreArray.sort()
	chores = choreArray[:n - k] + [x] * k
	RA = 0
	for item in chores:
		RA += item
	return RA
while True:
	try:
		line1 = input().split(' ')
		line2 = input().split(' ')
		(n, k, x) = (int(line1[0]), int(line1[1]), int(line1[2]))
		for i in range(len(line2)):
			line2[i] = int(line2[i])
		print(minTime(n, k, x, line2))
	except EOFError:
		break


(n, k, x) = map(int, input().split())
k = min(k, n)
print(sum([int(s) for s in input().split()][:-k]) + k * x)


(n, k, x) = map(int, input().split())
l = list(map(int, input().split()))
l.reverse()
sum1 = 0
for i in range(k):
	l[i] = x
for i in l:
	sum1 += i
print(sum1)


nkx = [int(i) for i in input().split(' ')]
ai = [int(i) for i in input().split(' ')]
k = nkx[1]
x = nkx[2]
ai = ai[:-k] + [x] * k
print(sum(ai))


(n, k, x) = map(int, input().split())
A = [int(y) for y in input().split()]
result = sum([A[i] for i in range(n - k)])
result += sum([min([x, A[i]]) for i in range(n - k, n)])
print(result)


(n, k, x) = map(int, input().split())
a = list(map(int, input().split()))
ost = n - k
res = 0
for i in range(ost):
	res += a[i]
print(res + k * x)


(n, k, x) = map(int, input().split())
ns = list(sorted(map(int, input().split())))
if k >= n:
	print(n * x)
else:
	print(sum([i for i in ns[:len(ns) - k]]) + k * x)


(n, k, x) = map(int, input().split())
a = list(map(int, input().split()))
if k <= n:
	su = k * x
else:
	su = n * x
su += sum(a[:-k])
print(su)


(n, k, t) = map(int, input().split())
l = list(map(int, input().split()))
l.sort()
ans = 0
for i in range(n - k):
	ans += l[i]
print(ans + k * t)


score = 0
(n, k, x) = list(map(int, input().split()))
a = list(map(int, input().split()))
for i in range(k):
	a.append(x)
a.sort()
for j in range(n):
	score += a[j]
print(score)


a = input()
b = input()
a1 = a.split()
b1 = b.split()
x = b1[0:len(b1) - int(a1[1])]
x1 = b1[len(b1) - int(a1[1]):]
sum = len(x1) * int(a1[2])
for i in range(len(x)):
	sum += int(x[i])
print(sum)


(n, k, x) = map(int, input().split())
line = list(map(int, input().split()))
sm = 0
for i in range(n - k):
	sm += line[i]
for i in range(n - k, n):
	sm += min(line[i], x)
print(sm)


(N, K, X) = map(int, input().split())
lst = sorted([int(i) for i in input().split()])
for i in range(1, K + 1):
	lst[-i] = X
print(sum(lst))


(n, k, x) = map(int, input().split())
lis = list(map(int, input().split()))
print(sum(lis[:len(lis) - k]) + k * x)


(n, k, x) = list(map(int, input().strip().split(' ')))
l = list(map(float, input().strip().split(' ')))
print(int(sum(l[0:n - k]) + x * k))


(n, k, x) = map(int, input().split())
a = list(map(int, input().split()))
ans = 0
a.sort(reverse=True)
for i in a:
	if k > 0 and i > x:
		k -= 1
		ans += x
	else:
		ans += i
print(ans)


(n, k, x) = list(map(int, input().split()))
a = sum((int(val) for (idx, val) in enumerate(input().split()) if idx < n - k))
print(a + k * x)


import math
import collections
import bisect
import heapq
import time
import random
(n, k, x) = map(int, input().split())
ts = [int(x) for x in input().split()]
for i in range(n - 1, n - k - 1, -1):
	ts[i] = min(ts[i], x)
print(sum(ts))


(n, k, x) = map(int, input().split())
lis = list(map(int, input().split()))
aa = sum(lis[:n - k]) + x * k
print(aa)


(n, k, x) = [int(p) for p in input().split()]
chores = [int(p) for p in input().split()]
time_it_took = 0
for chore in range(n):
	left_chore_count = n - chore
	if left_chore_count <= k and x < chores[chore]:
		time_it_took += x
	else:
		time_it_took += chores[chore]
print(time_it_took)


(n, k, x) = map(int, input().split())
ar = list(map(int, input().split()))
print(k * x + sum(ar[:-k]))


def main():
	(n, k, x) = map(int, input().split())
	a = list(map(int, input().split()))
	res = sum(a[:-k]) + k * x
	print(res)
main()


s = input()
(n, k, x) = s.split()
n = int(n)
k = int(k)
x = int(x)
s = input()
A = s.split()
A = list(map(int, A))
l = len(A)
t = 0
while k > 0:
	t = t + x
	k = k - 1
	A[l - 1] = 0
	l = l - 1
while l > 0:
	t = t + A[l - 1]
	l = l - 1
print(t)


(n, k, x) = map(int, input().split())
l = list(map(int, input().split()))
ans1 = sum(l)
ans2 = sum(l[0:n - k]) + k * x
print(min(ans1, ans2))


(n, k, x) = map(int, input().split())
arr = list(map(int, input().split()))
ans = 0
while k and arr and (arr[-1] > x):
	arr.pop()
	ans += x
	k -= 1
print(ans + sum(arr))


X = list(map(int, input().split()))
Y = list(map(int, input().split()))
print(sum(Y[:-X[1]]) + X[1] * X[2])


b = list(map(int, input().split()))
a = list(map(int, input().split()))
for i in range(len(a) - 1, len(a) - b[1] - 1, -1):
	a[i] = b[2]
print(sum(a))


(n, k, x) = [int(i) for i in input().split()]
durations = [int(i) for i in input().split()]
print(str(sum(durations[:-k]) + k * x))


def main():
	(n, k, x) = (int(y) for y in input().split())
	A = [int(x) for x in input().split()]
	print(solver(n, k, x, A))

def solver(n, k, x, A):
	start = n - k
	index = n
	for i in range(start, n):
		if A[i] > x:
			index = i
			break
	return sum(A[:index]) + (n - index) * x
main()


(n, k, x) = map(int, input().split())
times = tuple(map(int, input().split()))
print(sum(times[:n - k]) + k * x)


(n, k, x) = map(int, input().split())
l = [int(i) for i in input().split()]
l = l[::-1]
mini = sum(l)
loss = k * x
gain = sum(l[:k])
mini = min(mini, mini - gain + loss)
print(mini)


(n, k, x) = map(int, input().split())
l = list(map(int, input().split()))
s = sum(l[0:n - k]) + k * x
print(s)


inp = lambda : map(int, input().split())
(n, k, x) = input().split()
n = int(n)
k = int(k)
x = int(x)
a = list(inp())
cnt = k * x
for i in range(n - k):
	cnt += a[i]
print(cnt)


(n, k, x) = map(int, input().split())
a = list(map(int, input().split()))
for i in range(k):
	if max(a) >= x:
		a.remove(max(a))
		a.append(x)
print(sum(a))


R = lambda : list(map(int, input().split()))
(n, k, x) = R()
a = list(reversed(R()))
print(sum((x if i < k else a[i] for i in range(n))))


(n, k, x) = map(int, input().split())
a = list(map(int, input().split()))
for i in range(k):
	a[a.index(max(a))] = x
print(sum(a))


(n, m, p) = map(int, input().strip().split()[:3])
l = list(map(int, input().strip().split()[:n]))
k = len(l[n - m:]) * p
k1 = sum(l[:n - m])
print(k1 + k)


(n, k, x) = map(int, input().split())
t = [0] * 101
for i in map(int, input().split()):
	t[i] += 1
for i in range(100, -1, -1):
	if x < i and t[i] != 0:
		if k >= t[i]:
			t[x] += t[i]
			k -= t[i]
			t[i] = 0
		else:
			t[x] += k
			t[i] -= k
			k = 0
s = 0
for i in range(101):
	s += i * t[i]
print(s)


(n, k, x) = map(int, input().split())
l = sorted([int(i) for i in input().split()])[::-1]
lst = l[k:]
print(sum(lst) + k * x)