#include <bits/stdc++.h>
using namespace std;
vector<long long> a, b, c;
int main() {
  cin.sync_with_stdio(0);
  cin.tie(0);
  ;
  long long n, k1, k2;
  cin >> n >> k1 >> k2;
  k1 += k2;
  a.resize(n), b.resize(n), c.resize(n);
  for (long long i = 0; i < (long long)(n); i++) cin >> a[i];
  for (long long i = 0; i < (long long)(n); i++) cin >> b[i];
  for (long long i = 0; i < (long long)(n); i++) c[i] = abs(a[i] - b[i]);
  sort(c.begin(), c.end());
  reverse(c.begin(), c.end());
  while (k1) {
    if (c[0] != 0)
      c[0]--;
    else
      c[0]++;
    sort(c.begin(), c.end());
    reverse(c.begin(), c.end());
    k1--;
  }
  long long ans = 0;
  for (long long i = 0; i < (long long)(n); i++) ans += c[i] * c[i];
  cout << ans;
  return 0;
}
