A group of n schoolboys decided to ride bikes. As nobody of them has a bike, the boys need to rent them.

The renting site offered them m bikes. The renting price is different for different bikes, renting the j-th bike costs p_{j} rubles.

In total, the boys' shared budget is a rubles. Besides, each of them has his own personal money, the i-th boy has b_{i} personal rubles. The shared budget can be spent on any schoolchildren arbitrarily, but each boy's personal money can be spent on renting only this boy's bike.

Each boy can rent at most one bike, one cannot give his bike to somebody else.

What maximum number of schoolboys will be able to ride bikes? What minimum sum of personal money will they have to spend in total to let as many schoolchildren ride bikes as possible?


-----Input-----

The first line of the input contains three integers n, m and a (1 ≤ n, m ≤ 10^5; 0 ≤ a ≤ 10^9). The second line contains the sequence of integers b_1, b_2, ..., b_{n} (1 ≤ b_{i} ≤ 10^4), where b_{i} is the amount of the i-th boy's personal money. The third line contains the sequence of integers p_1, p_2, ..., p_{m} (1 ≤ p_{j} ≤ 10^9), where p_{j} is the price for renting the j-th bike.


-----Output-----

Print two integers r and s, where r is the maximum number of schoolboys that can rent a bike and s is the minimum total personal money needed to rent r bikes. If the schoolchildren cannot rent any bikes, then r = s = 0.


-----Examples-----
Input
2 2 10
5 5
7 6

Output
2 3

Input
4 5 2
8 1 1 2
6 3 7 5 2

Output
3 8



-----Note-----

In the first sample both schoolchildren can rent a bike. For instance, they can split the shared budget in half (5 rubles each). In this case one of them will have to pay 1 ruble from the personal money and the other one will have to pay 2 rubles from the personal money. In total, they spend 3 rubles of their personal money. This way of distribution of money minimizes the amount of spent personal money.

Difficulty: MEDIUM_HARD

Solutions:
(n, m, a) = list(map(int, input().split()))
b = sorted(map(int, input().split()))
p = sorted(map(int, input().split()))
left = 1
right = min(n, m)
while left <= right:
	mid = (left + right) // 2
	if a >= sum((max(0, x - y) for (x, y) in zip(p[:mid], b[-mid:]))):
		left = mid + 1
	else:
		right = mid - 1
print(right, max(0, sum(p[:right]) - a))


(n, m, a) = map(int, input().split())
(b, p) = (sorted(map(int, input().split())), sorted(map(int, input().split())))

def f(k):
	return sum((max(0, p[i] - b[n - k + i]) for i in range(k)))

def g(k):
	return sum((min(b[n - k + i], p[i]) for i in range(k)))
(x, y, d) = (0, min(n, m) + 1, a)
while y - x > 1:
	k = (x + y) // 2
	s = f(k)
	if s > a:
		y = k
	else:
		(x, d) = (k, s)
print(x, max(0, g(x) - a + d))


def check(mid):
	need = 0
	for i in range(mid):
		if mon[n - mid + i] < pri[i]:
			need += pri[i] - mon[n - mid + i]
	return need <= a
(n, m, a) = list(map(int, input().split()))
mon = sorted(map(int, input().split()))
pri = sorted(map(int, input().split()))
l = 0
r = min(n, m)
while l <= r:
	mid = l + (r - l) // 2
	if check(mid):
		l = mid + 1
	else:
		r = mid - 1
print(r, max(0, sum(pri[:r]) - a))


3

def readln():
	return tuple(map(int, input().split()))
(n, m, a) = readln()
b = list(sorted(readln()))
p = list(sorted(readln()))
l = ost = 0
r = min(m, n) + 1
while r - l > 1:
	k = (r + l) // 2
	s = d = 0
	for (x, y) in zip(b[-k:], p[:k]):
		if x < y:
			d += y - x
		s += y
	if d <= a:
		l = k
		ost = max(0, s - a)
	else:
		r = k
print(l, ost)


def readn():
	return map(int, input().split())
(n, m, a) = readn()
n = min(n, m)
m = n
b = sorted(readn())[-n:]
p = sorted(readn())
r = 0
while r < n:
	t = (r + 1 + n) // 2
	a1 = sum([max(0, p[i] - b[m + i - t]) for i in range(t)])
	if a1 <= a:
		r = t
	else:
		n = t - 1
print(r, max(0, sum(p[:r]) - a))


import sys
input = sys.stdin.readline
(n, m, a) = map(int, input().split())
b = list(map(int, input().split()))
p = list(map(int, input().split()))
b.sort(reverse=True)
p.sort()
l = 0
r = min(n, m) + 1
ans_use = 0
while r - l > 1:
	k = (l + r) // 2
	rem = a
	tar_b = b[:k][::-1]
	tar_p = p[:k]
	use = 0
	cnt = 0
	for i in range(k):
		if tar_b[i] >= tar_p[i]:
			use += tar_p[i]
			cnt += 1
		elif rem >= tar_p[i] - tar_b[i]:
			rem -= tar_p[i] - tar_b[i]
			use += tar_b[i]
			cnt += 1
		else:
			break
	if cnt == k:
		l = k
		ans_use = max(sum(tar_p) - a, 0)
	else:
		r = k
print(l, ans_use)


import os
import sys
from math import *
from collections import *
from bisect import *
from io import BytesIO, IOBase

def vsInput():
	sys.stdin = open('input.txt', 'r')
	sys.stdout = open('output.txt', 'w')
BUFSIZE = 8192

class FastIO(IOBase):
	newlines = 0

	def __init__(self, file):
		self._fd = file.fileno()
		self.buffer = BytesIO()
		self.writable = 'x' in file.mode or 'r' not in file.mode
		self.write = self.buffer.write if self.writable else None

	def read(self):
		while True:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			if not b:
				break
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines = 0
		return self.buffer.read()

	def readline(self):
		while self.newlines == 0:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			self.newlines = b.count(b'\n') + (not b)
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines -= 1
		return self.buffer.readline()

	def flush(self):
		if self.writable:
			os.write(self._fd, self.buffer.getvalue())
			(self.buffer.truncate(0), self.buffer.seek(0))

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')
(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
input = lambda : sys.stdin.readline().rstrip('\r\n')
ALPHA = 'abcdefghijklmnopqrstuvwxyz'
M = 10 ** 9 + 7
EPS = 1e-06

def Ceil(a, b):
	return a // b + int(a % b > 0)

def value():
	return tuple(map(int, input().split()))

def array():
	return [int(i) for i in input().split()]

def Int():
	return int(input())

def Str():
	return input()

def arrayS():
	return [i for i in input().split()]

def possible(x):
	b = boys[-x:]
	m = money[:x]
	need = 0
	for i in range(x):
		need += max(0, m[i] - b[i])
	return need <= a

def maxBoys():
	low = 0
	high = min(m, n)
	ans = 0
	while low <= high:
		mid = low + (high - low) // 2
		if possible(mid):
			low = mid + 1
			ans = mid
		else:
			high = mid - 1
	return ans
(n, m, a) = value()
boys = sorted(array())
money = sorted(array())[:n]
selected = maxBoys()
ans = 0
money = money[:selected]
print(selected, max(0, sum(money) - a))


wejscie1 = list(map(int, input().strip().split()))
ilChlopcow = wejscie1[0]
ilRowerow = wejscie1[1]
budzet = wejscie1[2]
pieniadzeChlopcow = list(map(int, input().strip().split()))
cenyRowerow = list(map(int, input().strip().split()))
pieniadzeChlopcow = sorted(pieniadzeChlopcow)
cenyRowerow = sorted(cenyRowerow)
bikesBoysCanRent = 0
totalCostOfRenting = 0
ownMoneyRequired = 0

def czyMoznaWypozyczyc(ilSprawdzonychRowerow):
	budzet2 = budzet
	if ilSprawdzonychRowerow > ilChlopcow:
		return False
	for x in range(ilSprawdzonychRowerow):
		roznica = pieniadzeChlopcow[ilChlopcow - x - 1] - cenyRowerow[ilSprawdzonychRowerow - x - 1]
		if roznica >= 0:
			continue
		budzet2 = budzet2 + roznica
		if budzet2 < 0:
			return False
	return True

def binarySearch(lewy, prawy):
	while lewy < prawy:
		mid = (lewy + prawy + 1) // 2
		if czyMoznaWypozyczyc(mid) == True:
			lewy = mid
		else:
			prawy = mid - 1
	return lewy
bikesBoysCanRent = binarySearch(0, ilRowerow)
for x in range(bikesBoysCanRent):
	totalCostOfRenting += cenyRowerow[x]
wyjscie2 = totalCostOfRenting - budzet
if wyjscie2 < 0:
	wyjscie2 = 0
print(bikesBoysCanRent, wyjscie2)


import sys, math

def is_fesiable(bike, per, a, mid):
	bik = bike[:mid]
	pe = per[:mid]
	pe.reverse()
	for i in range(mid):
		if pe[i] < bik[i]:
			a -= bik[i] - pe[i]
	if a < 0:
		return False
	else:
		return True

def main():
	(n, m, a) = map(int, sys.stdin.readline().strip().split())
	per = list(map(int, sys.stdin.readline().strip().split()))
	bike = list(map(int, sys.stdin.readline().strip().split()))
	per.sort(reverse=True)
	bike.sort()
	l = 0
	r = min(m, n)
	ans = 0
	while l <= r:
		mid = (l + r) // 2
		if is_fesiable(bike, per, a, mid):
			ans = mid
			l = mid + 1
		else:
			r = mid - 1
	cost = sum(bike[:ans])
	p = cost - a
	if p < 0:
		p = 0
	print(ans, p)
main()


import sys
cases = False

def fast_pow(a: int, b: int):
	res = 1
	while b > 0:
		if b & 1:
			res *= a
		a *= a
		b >>= 1
	return res

def c2(n):
	return n * (n - 1) // 2

def get():
	return list(map(int, input().split()))

def bits(n: int):
	return list(bin(n)).count('1')

def main(test_case=False):
	n = int(input()) if test_case else 1
	for _ in range(n):
		test()

def flush():
	sys.stdout.flush()

def parr(arr):
	print(*arr, sep=' ')

def gcd(a, b):
	while b:
		if b % a == 0:
			break
		tmp = a
		a = b % a
		b = tmp
	return a

def ext_gcd(a: int, b: int):
	if b == 0:
		return [a, [1, 0]]
	res = ext_gcd(b, a % b)
	g = res[0]
	x1 = res[1][0]
	y1 = res[1][1]
	x = y1
	y = x1 - y1 * (a // b)
	return [g, [x, y]]
b = []
p = []
n = m = a = 0

def check(cnt):
	if cnt == 0:
		return True
	x = b[-cnt:]
	y = p[:cnt]
	s = a
	i = 0
	while i < cnt and s >= 0:
		s -= max(0, y[i] - x[i])
		i += 1
	return s >= 0

def test():
	nonlocal n, m, a, b, p
	(n, m, a) = get()
	b = sorted(get())
	p = sorted(get())
	left = 0
	right = min(n, m)
	ans = -1
	while left <= right:
		mid = (left + right) // 2
		if check(mid):
			ans = max(ans, mid)
			left = mid + 1
		else:
			right = mid - 1
	if ans == -1:
		print(0, 0)
		return
	t = 0
	x = b[-ans:]
	y = p[:ans]
	i = 0
	while i < ans:
		t += min(x[i], y[i])
		a -= max(0, y[i] - x[i])
		i += 1
	print(ans, max(0, t - a))
main(cases)


import os
from io import BytesIO, IOBase
import sys
from collections import defaultdict, deque, Counter
from math import sqrt, pi, ceil, log, inf, gcd, floor
from itertools import combinations
from bisect import *

def check(b, p, a, mid):
	(y, z) = (0, a)
	for i in range(mid - 1, -1, -1):
		y += p[i]
		a -= max(0, p[i] - b[i - mid])
		if a < 0:
			return 0
	return (mid, max(0, y - z))

def main():
	(n, m, a) = map(int, input().split())
	b = sorted(map(int, input().split()))
	p = sorted(map(int, input().split()))
	(lo, hi, z) = (0, min(n, m), 0)
	while lo <= hi:
		mid = (lo + hi) // 2
		x = check(b, p, a, mid)
		if x:
			z = x
			lo = mid + 1
		else:
			hi = mid - 1
	print(*z)
BUFSIZE = 8192

class FastIO(IOBase):
	newlines = 0

	def __init__(self, file):
		self._fd = file.fileno()
		self.buffer = BytesIO()
		self.writable = 'x' in file.mode or 'r' not in file.mode
		self.write = self.buffer.write if self.writable else None

	def read(self):
		while True:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			if not b:
				break
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines = 0
		return self.buffer.read()

	def readline(self):
		while self.newlines == 0:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			self.newlines = b.count(b'\n') + (not b)
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines -= 1
		return self.buffer.readline()

	def flush(self):
		if self.writable:
			os.write(self._fd, self.buffer.getvalue())
			(self.buffer.truncate(0), self.buffer.seek(0))

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')
(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
input = lambda : sys.stdin.readline().rstrip('\r\n')
main()


import math

def check(n, mid, bike, price, a):
	need = 0
	for i in range(mid):
		if bike[n - mid + i] < price[i]:
			need += price[i] - bike[n - mid + i]
	return need <= a

def prob():
	(n, m, a) = map(int, input().split())
	bike = list(map(int, input().split()))
	price = list(map(int, input().split()))
	bike.sort()
	price.sort()
	l = 0
	r = min(n, m)
	while l <= r:
		mid = (l + r) // 2
		if check(n, mid, bike, price, a):
			l = mid + 1
		else:
			r = mid - 1
	print(r, max(0, sum(price[:r]) - a))
t = 1
for _ in range(0, t):
	prob()


import sys
input = sys.stdin.readline

def check(val, money):
	j = 0
	for i in range(n - val, n):
		if b[i] >= p[j]:
			j += 1
			continue
		diff = p[j] - b[i]
		if money - diff < 0:
			return 0
		money -= diff
		j += 1
	return 1
for _ in range(1):
	(n, m, a) = map(int, input().split())
	b = list(map(int, input().split()))
	p = list(map(int, input().split()))
	b.sort()
	p.sort()
	low = 0
	high = min(n, m)
	r = 0
	while low <= high:
		mid = low + (high - low) // 2
		if check(mid, a):
			r = mid
			low = mid + 1
		else:
			high = mid - 1
	val = r
	cost = max(sum(p[0:val]) - a, 0)
	print(val, cost)


import math
import bisect
import itertools
import sys
I = lambda : sys.stdin.readline()
one = lambda : int(I())
more = lambda : map(int, I().split())
linput = lambda : list(more())
mod = 10 ** 9 + 7
inf = 10 ** 18 + 1

def merge(a, b):
	i = 0
	j = 0
	c = 0
	ans = []
	while i < len(a) and j < len(b):
		if a[i] < b[j]:
			ans.append(a[i])
			i += 1
		else:
			ans.append(b[j])
			c += len(a) - i
			j += 1
	ans += a[i:]
	ans += b[j:]
	return (ans, c)

def mergesort(a):
	if len(a) == 1:
		return (a, 0)
	mid = len(a) // 2
	(left, left_inversion) = mergesort(a[:mid])
	(right, right_inversion) = mergesort(a[mid:])
	(m, c) = merge(left, right)
	c += left_inversion + right_inversion
	return (m, c)

def is_prime(num):
	if num == 1:
		return False
	if num == 2:
		return True
	if num == 3:
		return True
	if num % 2 == 0:
		return False
	if num % 3 == 0:
		return False
	t = 5
	a = 2
	while t <= int(math.sqrt(num)):
		if num % t == 0:
			return False
		t += a
		a = 6 - a
	return True

def ceil(a, b):
	return (a + b - 1) // b
(n, m, k) = more()
mon = linput()
bike = linput()
mon.sort()
bike.sort()
low = 0
high = min(n, m)

def check(mid, k):
	for j in range(mid):
		k -= max(-mon[-j - 1] + bike[mid - j - 1], 0)
	if k >= 0:
		return k + 1
	return 0
while low < high:
	mid = (low + high + 1) // 2
	if check(mid, k):
		low = mid
	else:
		high = mid - 1
kharch = sum(bike[:low])
print(low, max(kharch - k, 0))


import os, sys
from io import BytesIO, IOBase

def check(mid, b, p, a):
	if mid > len(p):
		return 0
	tot = 0
	a1 = a
	for i in range(1, mid + 1):
		tot += p[mid - i]
		a -= max(0, p[mid - i] - b[-i])
	if a < 0:
		return 0
	return (mid, max(0, tot - a1))

def main():
	(n, m, a) = map(int, input().split())
	b = sorted(list(map(int, input().split())))
	p = sorted(list(map(int, input().split())))
	(hi, lo, mini) = (n, 1, (0, 0))
	while hi >= lo:
		mid = (hi + lo) // 2
		x = check(mid, b, p, a)
		if x:
			mini = x
			lo = mid + 1
		else:
			hi = mid - 1
	print(*mini)
BUFSIZE = 8192

class FastIO(IOBase):
	newlines = 0

	def __init__(self, file):
		self._fd = file.fileno()
		self.buffer = BytesIO()
		self.writable = 'x' in file.mode or 'r' not in file.mode
		self.write = self.buffer.write if self.writable else None

	def read(self):
		while True:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			if not b:
				break
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines = 0
		return self.buffer.read()

	def readline(self):
		while self.newlines == 0:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			self.newlines = b.count(b'\n') + (not b)
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines -= 1
		return self.buffer.readline()

	def flush(self):
		if self.writable:
			os.write(self._fd, self.buffer.getvalue())
			(self.buffer.truncate(0), self.buffer.seek(0))

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')
(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
input = lambda : sys.stdin.readline().rstrip('\r\n')
main()


import os
import sys
from io import BytesIO, IOBase
BUFSIZE = 8192

class FastIO(IOBase):
	newlines = 0

	def __init__(self, file):
		self._fd = file.fileno()
		self.buffer = BytesIO()
		self.writable = 'x' in file.mode or 'r' not in file.mode
		self.write = self.buffer.write if self.writable else None

	def read(self):
		while True:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			if not b:
				break
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines = 0
		return self.buffer.read()

	def readline(self):
		while self.newlines == 0:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			self.newlines = b.count(b'\n') + (not b)
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines -= 1
		return self.buffer.readline()

	def flush(self):
		if self.writable:
			os.write(self._fd, self.buffer.getvalue())
			(self.buffer.truncate(0), self.buffer.seek(0))

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')
(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
input = lambda : sys.stdin.readline().rstrip('\r\n')

def list2d(a, b, c):
	return [[c] * b for i in range(a)]

def list3d(a, b, c, d):
	return [[[d] * c for j in range(b)] for i in range(a)]

def list4d(a, b, c, d, e):
	return [[[[e] * d for j in range(c)] for j in range(b)] for i in range(a)]

def ceil(x, y=1):
	return int(-(-x // y))

def Yes():
	print('Yes')

def No():
	print('No')

def YES():
	print('YES')

def NO():
	print('NO')
INF = 10 ** 18
MOD = 10 ** 9 + 7
Ri = lambda : [int(x) for x in sys.stdin.readline().split()]
ri = lambda : sys.stdin.readline().strip()
(n, m, left) = Ri()
a = Ri()
b = Ri()
a.sort()
b.sort()

def solve(no):
	if no > m:
		return -1
	tleft = left
	mo = 0
	(i, j) = (n - no, 0)
	while i < n:
		if a[i] >= b[j]:
			mo += b[j]
		else:
			tleft -= b[j] - a[i]
			if tleft < 0:
				return -1
			mo += a[i]
		i += 1
		j += 1
	return max(0, mo - tleft)
(l, r) = (0, n)
ans = 10 ** 18
totno = 0
while l <= r:
	mid = (l + r) // 2
	temp = solve(mid)
	if temp != -1:
		totno = max(totno, mid)
		ans = temp
		l = mid + 1
	else:
		r = mid - 1
print(totno, ans)


K = int(input().split()[2])
A = list(map(int, input().split()))
B = list(map(int, input().split()))

def canMake(partA, partB, K):
	for (a, b) in zip(partA, partB):
		if a >= b:
			pass
		else:
			K -= b - a
		if K < 0:
			return -1
	return K

def paramSearch(A, B, K):
	L = 0
	R = min(len(A), len(B)) + 1
	while L < R:
		M = int(L + (R - L) / 2)
		if canMake(A[-M:], B[:M], K) >= 0:
			L = M + 1
		else:
			R = M
	return L
A.sort()
B.sort()
bike = paramSearch(A, B, K) - 1
print(bike, end=' ')
print(0 if sum(B[:bike]) - K < 0 else sum(B[:bike]) - K)