Given an array A consisting of N distinct integers (1 ≤ A_{i} ≤ 2 \cdot N), we have to perform K moves.
We perform the following steps in one move:

Select an integer X such that 1 ≤ X ≤ 2 \cdot N and X \ne A_{i} for all i (X is not equal to any element of the current array).
Append X to A.
The *score* of this move = (\max_{1 ≤ i ≤ |A|} A_{i}) - X.  
Note that the *score* is calculated after appending X. Thus, X can be the maximum element of the array as well.

For e.g. if A = [3, 1, 5] and we append X = 2 to A, then, A becomes [3, 1, 5, 2] and the *score* of this move is \max([3, 1, 5, 2]) - 2 = 5 - 2 = 3.

Find the maximum sum of *scores* we can achieve after performing exactly K moves.

------ Input Format ------ 

- The first line of input will contain a single integer T, denoting the number of test cases.
- Each test case consists of multiple lines of input.
- The first line of each test case contains three space-separated integers N and K — the size of the array A and the number of moves respectively.
- The second line of each test case contains N space-separated integers A_{1}, A_{2}, \dots, A_{N} denoting the array A.

------ Output Format ------ 

For each test case, output the maximum sum of *scores* we can achieve after performing exactly K moves.  
It is guaranteed that it is always possible to perform K moves under the given constraints. 

------ Constraints ------ 

$1 ≤ T ≤ 10^{5}$
$1 ≤ N ≤ 10^{5}$
$1 ≤K ≤N$
$1 ≤ A_{i} ≤ 2 \cdot N$
- All $A_{i}$ are distinct.
- Sum of $N$ over all test cases does not exceed $2 \cdot 10^{5}$.

----- Sample Input 1 ------ 
3
3 1
1 3 6
2 2
1 2
3 2
1 2 5

----- Sample Output 1 ------ 
4
1
3

----- explanation 1 ------ 
Test Case 1: We can perform the following move:
- Append $X = 2$. Score of this move $= \max([1, 3, 6, 2]) - 2 = 6 - 2 = 4$

Hence, the maximum total score is $4$.

Test Case 2: We can perform the following moves:
- Append $X = 4$. Score of this move $= \max([1, 2, 4]) - 4 = 4 - 4 = 0$
- Append $X = 3$. Score of this move $= \max([1, 2, 4, 3]) - 3 = 4 - 3 = 1$

Hence, the maximum total score is $0+1=1$.

Test Case 3: We can perform the following moves:
- Append $X = 4$. Score of this move $= \max([1, 2, 5, 4]) - 4 = 5 - 4 = 1$
- Append $X = 3$. Score of this move $= \max([1, 2, 5, 4, 3]) - 3 = 5 - 3 = 2$

Hence the maximum total score is $1+2=3$.

Difficulty: MEDIUM_HARD

Solutions:
t = int(input())
for i in range(t):
	(n, k) = input().split()
	n = int(n)
	k = int(k)
	A = [int(x) for x in input().split()]
	B = []
	m = max(A)
	M = 2 * n
	count = 0
	if min(A) != 1:
		count = 1
		B.append(1)
		A.append(1)
		n += 1
	sum1 = 0
	sum2 = 0
	A.sort()
	for j in range(n - 1):
		d = A[j + 1] - A[j]
		if A[j + 1] - A[j] > 1:
			for l in range(d - 1):
				B.append(A[j] + 1 + l)
				count += 1
				if count == k:
					break
					break
		if count == k:
			break
	if count < k:
		for j in range(k - count):
			B.append(m + 1 + j)
	for j in range(k):
		sum1 += m - B[j]
		sum2 += M - B[j]
	sum2 -= M - B[k - 1]
	print(max(sum1, sum2))


import numpy as np
testcase = int(input())
for _ in range(testcase):
	score = 0
	(N, K) = map(lambda x: int(x), input().split(' '))
	A = set(map(lambda x: int(x), input().split(' ')))
	maxval = N * 2
	full_list = {i + 1 for i in range(N * 2)}
	missing_values = sorted(list(A ^ full_list))
	print(max([(K - 1) * maxval - sum(missing_values[0:K - 1]), K * max(A) - sum(missing_values[0:K])]))


def distinct_numbers(arr, N, K):
	cur = [0 for _ in range(2 * N + 1)]
	missing = []
	for val in arr:
		cur[val] = 1
	for i in range(1, 2 * N + 1):
		if cur[i] == 0:
			missing.append(i)
	max_val = max(arr)
	first = 2 * N * (K - 1) - sum(missing[:K - 1])
	second = max_val * K - sum(missing[:K])
	print(max(first, second))
T = int(input())
for _ in range(T):
	(N, K) = tuple(map(int, input().split()))
	arr = list(map(int, input().split()))
	distinct_numbers(arr, N, K)


t = int(input())
for _ in range(t):
	(n, k) = map(int, input().split())
	arr = list(map(int, input().split()))
	cur = [0 for _ in range(2 * n + 1)]
	missing = []
	for val in arr:
		cur[val] = 1
	for i in range(1, 2 * n + 1):
		if cur[i] == 0:
			missing.append(i)
	first = 2 * n * (k - 1) - sum(missing[:k - 1])
	second = max(arr) * k - sum(missing[:k])
	print(max(first, second))


for i in range(int(input())):
	(n, k) = map(int, input().split())
	array = list(map(int, input().split()))
	mar = [0] * (2 * n + 1)
	b = []
	for ele in array:
		mar[ele] = 1
	for i in range(1, 2 * n + 1):
		if mar[i] == 0:
			b.append(i)
	mxm = max(array)
	an = int(-10 ** 13)
	an = max(an, (k - 1) * (2 * n) - sum(b[0:k - 1]))
	an = max(an, k * mxm - sum(b[0:k]))
	print(an)


h = int(input())
for _ in range(h):
	(n, k) = map(int, input().split())
	l = list(map(int, input().split()))
	m = n * 2
	mx = max(l)
	ansa = 0
	ansb = 0
	f = [0] * (m + 1)
	for i in range(n):
		f[l[i]] = 1
	for i in range(1, 2 * n):
		if f[i] == 1:
			continue
		else:
			ansa += mx - i
			if k != 1:
				ansb += 2 * n - i
				k -= 1
			else:
				break
	print(max(ansa, ansb))


for _ in range(int(input())):
	(n, k) = map(int, input().split())
	arr = list(map(int, input().split()))
	mark = [0] * (2 * n + 1)
	b = []
	for elem in arr:
		mark[elem] = 1
	for i in range(1, 2 * n + 1):
		if mark[i] == 0:
			b.append(i)
	mx = max(arr)
	ans = int(-10 ** 13)
	ans = max(ans, (k - 1) * (2 * n) - sum(b[0:k - 1]))
	ans = max(ans, k * mx - sum(b[0:k]))
	print(ans)


numInp = lambda : int(input())
lstImp = lambda : list(map(int, input().split()))
strImp = lambda : input()
spacedStrImp = lambda : list(input())
seperateImp = lambda : map(int, input().split())
for i in range(int(input())):
	(lenOfLst, numOfMoves) = seperateImp()
	lst = lstImp()
	limit = lenOfLst * 2
	maxValue = max(lst)
	possibleElements = [0] * (limit + 1)
	possibleOutput1 = 0
	possibleOutput2 = 0
	for i in lst:
		possibleElements[i] += 1
	for i in range(1, limit):
		if possibleElements[i] != 1:
			possibleOutput1 += maxValue - i
			if numOfMoves == 1:
				break
			else:
				possibleOutput2 += limit - i
				numOfMoves -= 1
	print(max(possibleOutput1, possibleOutput2))


from functools import reduce
T = int(input())
for _ in range(T):
	(N, K) = map(int, input().split(' '))
	A = list(map(int, input().split(' ')))

	def solve():
		max_a = reduce(max, A)
		elms = set(A)
		ap1 = 0
		ap2 = 0
		moves = 0
		idx = 0
		while moves < K:
			idx += 1
			if idx in elms:
				continue
			if K - moves > 1:
				ap1 += 2 * N - idx
			ap2 += max_a - idx
			moves += 1
		return max(ap1, ap2)
	print(solve())


t = int(input())
for _ in range(t):
	(n, k) = map(int, input().split())
	arr = list(map(int, input().split()))
	mark = [0] * (2 * n + 1)
	a = []
	for x in arr:
		mark[x] = 1
	for i in range(1, 2 * n + 1):
		if mark[i] == 0:
			a.append(i)
	m = max(arr)
	ans = int(-10 ** 13)
	ans = max(ans, (k - 1) * (2 * n) - sum(a[0:k - 1]))
	ans = max(ans, k * m - sum(a[0:k]))
	print(ans)


t = int(input())
for i in range(t):
	(n, k) = map(int, input().split())
	a = list(map(int, input().split()))
	z = max(a)
	not_a = []
	d = [0] * (2 * n + 1)
	for j in a:
		d[j] = 1
	for j in range(1, 2 * n + 1):
		if d[j] == 0:
			not_a.append(j)
	p = k * z - sum(not_a[:k])
	q = (k - 1) * 2 * n - sum(not_a[:k - 1])
	print(max(p, q))


for i in range(int(input())):
	(n, k) = map(int, input().split())
	a = list(map(int, input().split()))
	b = a[:]
	m = [0] * (n * 2 + 1)
	for i in a:
		m[i] = 1
	l = []
	for i in range(1, 2 * n + 1):
		if m[i] == 0:
			l.append(i)
	max_a = max(a)
	t1 = k * max_a - sum(l[:k])
	t2 = (k - 1) * 2 * n - sum(l[:k - 1])
	print(max(t1, t2))


from collections import Counter
for _ in range(int(input())):
	(n, m) = map(int, input().split())
	l = list(map(int, input().split()))
	l1 = Counter(l)
	l2 = []
	res = max(l)
	tot = 0
	tot1 = 0
	for i in range(1, 2 * n + 1):
		if l1[i] == 0:
			l2.append(i)
	for i in range(m):
		if res > l2[i]:
			tot += res - l2[i]
		if i < m - 1:
			tot1 += 2 * n - l2[i]
	print(max(tot, tot1))