#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, k1, k2;
  cin >> n >> k1 >> k2;
  int k = k1 + k2;
  vector<long long> a(n);
  for (auto &x : a) {
    cin >> x;
  }
  vector<long long> b(n);
  for (auto &x : b) {
    cin >> x;
  }
  vector<long long> p(n);
  for (int i = 0; i < n; i++) {
    p[i] = abs(a[i] - b[i]);
  }
  while (k > 0) {
    auto i = max_element(p.begin(), p.end());
    if (*i == 0) {
      break;
    }
    (*i)--;
    k--;
  }
  long long ans = 0;
  for (int i = 0; i < n; i++) {
    ans += p[i] * p[i];
  }
  cout << ans + k % 2;
  return 0;
}
