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: interview

Starter code:

Solutions:
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)


3
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))

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))

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))

#!/usr/bin/env python3

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))


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







def readn():
  return list(map(int, input().split()))
n,m,a=readn()#map(int,input().split())
b,p=sorted(map(int,input().split()))[-min(n,m):],sorted(map(int,input().split()))
r=min(n,m)
mm=r
l=0
while l<=r:
    mid=l+(r-l)//2
    pri=sum([max(0,p[i]-b[mm-mid+i]) for i in range(mid)])
    if pri<=a:
        l=mid+1
    else:
        r=mid-1
print(r,max(0,sum(p[:r])-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)


def check(mid):
    need=0
    for i in range(mid):
#        print(mid,n-mid+i,i,mon,pri)
        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)
#print(mon,pri)
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))




import sys

cases = False

# Pre-defined function
# Begin
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]]

# End

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
 
    # print(ans)
 
    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)