#include <bits/stdc++.h>
using namespace std;
signed main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  long long n, k1, k2;
  cin >> n >> k1 >> k2;
  long long k = k1 + k2;
  vector<long long> a(n);
  for (long long i = 0; i < n; ++i) {
    cin >> a[i];
  }
  for (long long i = 0; i < n; ++i) {
    long long x;
    cin >> x;
    a[i] = abs(a[i] - x);
  }
  multiset<long long> s(a.begin(), a.end());
  for (long long i = 0; i < k; ++i) {
    long long loc = *s.rbegin();
    s.erase(--s.end());
    if (loc == 0) {
      s.insert(1);
    } else {
      s.insert(loc - 1);
    }
  }
  long long ans = 0;
  for (long long elem : s) {
    ans += elem * elem;
  }
  cout << max(0ll, ans);
  return 0;
}
