#include <bits/stdc++.h>   using namespace std;   long long int b[100005], p[100005];   int n, m, a;   bool check(int x) {     int temp_a = a;     for (__typeof((x)) i = (0); i < (x); i += 1) {       int t = x - 1;       if (p[i] > b[t - i]) {         if (temp_a < p[i] - b[t - i]) {           return false;         } else {           temp_a -= p[i] - b[t - i];         }       }     }     return true;   }   int main() {     ios_base::sync_with_stdio(false);     cin.tie(0);     cout.tie(0);     cin >> n >> m >> a;     for (__typeof((n)) i = (0); i < (n); i += 1) {       cin >> b[i];     }     for (__typeof((m)) i = (0); i < (m); i += 1) {       cin >> p[i];     }     sort(b, b + n, greater<int>());     sort(p, p + m);     int l = 0, h = ((n) < (m) ? (n) : (m)), ans = 0;     while (l < h) {       int mid = (l + h + 1) / 2;       if (check(mid) == true) {         l = mid;       } else {         h = mid - 1;       }       ans = l;     }     int ans2 = 0;     for (__typeof((ans)) i = (0); i < (ans); i += 1) {       ans2 += p[i];     }     ans2 -= a;     if (ans2 < 0) {       ans2 = 0;     }     cout << ans <<     << ans2;   }   