Chef spent N days working really hard! He planned loads of tasks: as many as Ai tasks to do on the ith day! Chef's work was brutal, so he only managed to finish Bi tasks on the ith day.
The good news is that Chef has a Time Machine! 
The Time Machine has K white buttons and M black buttons. Each button has a positive integer printed on it. Now Chef goes through all N days consequently and presses buttons. Each day Chef can only press one button (either white or black). After using a button once, it becomes inactive.
Pressing a white button with integer x printed on it reduces the number of planned tasks on the day it was pressed by exactly x. Note that this white button can only be pressed if number of planned tasks on the day are greater than or equal to x.
Pressing a black button with integer x printed on it increases the number of completed tasks on the day it was pressed by exactly x. Note that this black button can only be pressed if after pressing it, number of completed tasks don't exceed the number of tasks.
Chef is interested in finding the minimum possible amount of total uncompleted tasks he will still be left with after N days using the Machine in the best way?
Be careful! Time is sensitive! Chef cannot make a day when he completed more tasks then planned, as this may result in a more-work-than-planned paradox, killing all lazy people on the planet!

-----Input-----
- The first line of input contains a single integer T, denoting the number of test cases. Description of T test cases follows.
- The first line of each test case contains three integers — N, K, M — denoting the number of days, white and black buttons appropriately.
- The second line contains N space-separated integers A1, A2, … , AN, denoting the number of planned tasks.
- The third line contains N space-separated integers B1, B2, … , BN, denoting the number of completed tasks.
- The fourth line contains K space-separated integers C1, C2, … , CK, denoting the integers on white buttons.
- The fifth and last line contains M space-separated integers D1, D2, … , DM, denoting the integers on black buttons.

-----Output-----
- In a single line, output an integer — the minimum possible amount of uncompleted tasks.

-----Constraints-----
- 1 ≤ T ≤ 4
- 1 ≤ N, K, M ≤ 10^5
- 1 ≤ Bi ≤ Ai  ≤ 10^5
- 1 ≤ Ci, Di  ≤ 10^5

-----Subtasks-----
- Subtask N ≤ 10, K, M ≤ 5. Points: 30 
- Subtask Original constraints. Points: 70 

-----Example-----
Input:
1
4 2 2 
5 7 6 1
3 3 1 1
6 3
1 4

Output:
3

-----Explanation-----
Example case 1.
In this example Chef goes through the following steps:
Use black button 1 on the first day.
Use black button 4 on the second day.
Use white button 3 on the third day.
The arrays A and B are now effectively changed to:
5 7 3 1
4 7 1 1
So he will have 3 uncompleted tasks.

Difficulty: UNKNOWN_DIFFICULTY

Starter code:

Solutions:
t = int(input())

def diffe(a, b):
	return int(a - b)
while t:
	t = t - 1
	lia = []
	lib = []
	lik = []
	lim = []
	liab = []
	likm = []
	(n, k, m) = list(map(int, input().split()))
	lia = list(map(int, input().split()))
	lib = list(map(int, input().split()))
	lik = list(map(int, input().split()))
	lim = list(map(int, input().split()))
	liab = list(map(diffe, lia, lib))
	likm = lik + lim
	likm.sort()
	liab.sort()
	liab.reverse()
	for i in range(0, len(liab)):
		for j in range(len(likm) - 1, 0 - 1, -1):
			a = likm.pop()
			if liab[i] - a >= 0:
				liab[i] = liab[i] - a
				break
	print(sum(liab))


for tests in range(eval(input())):
	[N, K, M] = list(map(int, input().split()))
	A = list(map(int, input().split()))
	B = list(map(int, input().split()))
	C = list(map(int, input().split()))
	D = list(map(int, input().split()))
	E = [0] * N
	F = [0] * (K + M)
	for i in range(N):
		E[i] = A[i] - B[i]
	for i in range(K):
		F[i] = C[i]
	for i in range(M):
		F[i + K] = D[i]
	E = sorted(E, reverse=True)
	F = sorted(F, reverse=True)
	k = 0
	for i in range(K + M):
		if E[k] >= F[i]:
			E[k] = E[k] - F[i]
			k = k + 1
	print(sum(E))


def minTasks(diff, buttons):
	(i, j) = (0, 0)
	incompleteTasks = 0
	while i < len(diff) and j < len(buttons):
		if diff[i] >= buttons[j]:
			incompleteTasks += diff[i] - buttons[j]
			i += 1
			j += 1
		else:
			j += 1
	while i < len(diff):
		incompleteTasks += diff[i]
		i += 1
	return incompleteTasks
from sys import stdin
t = int(stdin.readline())
while t > 0:
	(n, k, m) = list(map(int, stdin.readline().split()))
	planned = list(map(int, stdin.readline().split()))
	completed = list(map(int, stdin.readline().split()))
	white = list(map(int, stdin.readline().split()))
	black = list(map(int, stdin.readline().split()))
	buttons = white + black
	buttons.sort(reverse=True)
	diff = []
	for i in range(n):
		diff.append(planned[i] - completed[i])
	diff.sort(reverse=True)
	print(minTasks(diff, buttons))
	t -= 1


import sys, bisect
t = int(input())
for _ in range(t):
	(n, k, m) = list(map(int, input().split()))
	p = list(map(int, input().split()))
	c = list(map(int, input().split()))
	w = list(map(int, input().split()))
	b = list(map(int, input().split()))
	w.sort()
	b.sort()
	uncomp = 0
	for x in range(n):
		diff = p[x] - c[x]
		i = bisect.bisect_right(w, diff)
		j = bisect.bisect_right(b, diff)
		if i:
			w0 = w[i - 1]
		else:
			w0 = -1
		if j:
			b0 = b[j - 1]
		else:
			b0 = -1
		if w0 > b0 and w0 != -1:
			p[x] -= w0
			del w[i - 1]
		elif b0 != -1:
			c[x] += b0
			del b[j - 1]
		uncomp += p[x] - c[x]
	print(uncomp)


tc = int(input())
for it in range(tc):
	(n, k, m) = list(map(int, input().split()))
	cnt = 0
	cntr = k + m
	a = list(map(int, input().split()))
	b = list(map(int, input().split()))
	c = list(map(int, input().split()))
	d = list(map(int, input().split()))
	for it1 in range(m):
		c.append(d[it1])
	for j in range(n):
		a[j] = a[j] - b[j]
		cnt = cnt + a[j]
	a.sort()
	c.sort()
	while n > 0 and cntr > 0:
		if a[n - 1] >= c[cntr - 1]:
			cnt = cnt - c[cntr - 1]
			cntr = cntr - 1
			n = n - 1
		else:
			cntr = cntr - 1
	print(cnt)


import operator
from collections import Counter
from bisect import bisect_left
for _ in range(0, int(input())):
	[a, b, c] = list(map(int, input().strip().split()))
	x1 = list(map(int, input().strip().split()))
	x2 = list(map(int, input().strip().split()))
	y1 = list(map(int, input().strip().split()))
	z1 = list(map(int, input().strip().split()))
	x = list(map(operator.sub, x1, x2))
	x.sort()
	z = y1 + z1
	zc = Counter(z)
	z = list(zc.keys())
	z.sort()
	s = len(z)
	d = b + c
	tot = 0
	refpos = 0
	for p in x:
		pos = -1
		if s > 0:
			pos = bisect_left(z, p)
			if pos == s:
				pos = pos - 1
			elif z[pos] != p:
				pos = pos - 1
		if pos > -1:
			tot += p - z[pos]
			zc[z[pos]] -= 1
			d -= 1
			if zc[z[pos]] == 0:
				del z[pos]
				s -= 1
		else:
			tot += p
	print(tot)


import operator
from collections import Counter
for _ in range(0, int(input())):
	[a, b, c] = list(map(int, input().strip().split()))
	x1 = list(map(int, input().strip().split()))
	x2 = list(map(int, input().strip().split()))
	y1 = list(map(int, input().strip().split()))
	z1 = list(map(int, input().strip().split()))
	x = list(map(operator.sub, x1, x2))
	x.sort()
	z = y1 + z1
	zc = Counter(z)
	z = list(zc.keys())
	z.sort()
	tot = 0
	for p in x:
		minq = 1000000
		pos = -1
		ctrpos = 0
		for q in z:
			if q > p:
				break
			if p - q < minq:
				minq = p - q
				pos = ctrpos
			ctrpos += 1
		if pos != -1:
			tot += minq
			zc[z[pos]] -= 1
			if zc[z[pos]] == 0:
				del z[pos]
		else:
			tot += p
	print(tot)


from numpy import array
for _ in range(0, int(input())):
	[a, b, c] = list(map(int, input().strip().split()))
	x1 = array(list(map(int, input().strip().split())))
	x2 = array(list(map(int, input().strip().split())))
	y1 = list(map(int, input().strip().split()))
	z1 = list(map(int, input().strip().split()))
	x = x1 - x2
	x.sort()
	z = array(y1 + z1)
	z.sort()
	z = z.tolist()
	tot = 0
	for p in x:
		minq = 1000000
		pos = -1
		ctrpos = 0
		for q in z:
			if q > p:
				break
			if p - q < minq:
				minq = p - q
				pos = ctrpos
			ctrpos += 1
		if pos != -1:
			tot += minq
			del z[pos]
		else:
			tot += p
	print(tot)


for _ in range(eval(input())):
	(n, k, m) = list(map(int, input().split()))
	a = list(map(int, input().split()))
	b = list(map(int, input().split()))
	c = [i - j for (i, j) in zip(a, b)]
	d = list(map(int, input().split())) + list(map(int, input().split()))
	c.sort(reverse=True)
	d.sort(reverse=True)
	j = 0
	for i in range(len(d)):
		if j >= n:
			break
		if c[j] >= d[i]:
			c[j] -= d[i]
			j += 1
	print(sum(c))


t = int(input())
for i in range(t):
	inp1 = str(input()).split()
	N = int(inp1[0])
	K = int(inp1[1])
	M = int(inp1[2])
	A = str(input()).split()
	B = str(input()).split()
	C = str(input()).split()
	D = str(input()).split()
	R = [0] * N
	arr = [0] * (K + M)
	for j in range(K):
		arr[j] = int(C[j])
	for j in range(M):
		arr[j + K] = int(D[j])
	arr.sort()
	arr = arr[::-1]
	for j in range(N):
		R[j] = int(A[j]) - int(B[j])
	R.sort()
	R = R[::-1]
	ii = 0
	fl = 0
	for j in range(N):
		while 1:
			if ii >= K + M:
				fl = 1
				break
			if arr[ii] <= R[j]:
				break
			else:
				ii += 1
		if fl == 1:
			break
		R[j] -= arr[ii]
		ii += 1
	su = sum(R)
	print(su)