#include <bits/stdc++.h>
using namespace std;
const int N = 1e5 + 5;
int c[N];
int a[N], b[N];
int main() {
  int n, k1, k2;
  cin >> n >> k1 >> k2;
  for (int i = 0; i < n; ++i) scanf("%d", a + i);
  for (int i = 0; i < n; ++i) scanf("%d", b + i);
  for (int i = 0; i < n; ++i) {
    c[i] = a[i] - b[i];
    if (c[i] < 0) c[i] = -c[i];
  }
  priority_queue<int> Q;
  for (int i = 0; i < n; ++i) Q.push(c[i]);
  int k = k1 + k2;
  bool f = false;
  while (k--) {
    int t = Q.top();
    Q.pop();
    if (t == 0) {
      k += 1;
      f = true;
      break;
    }
    Q.push(t - 1);
  }
  if (f) {
    if (k & 1) {
      printf("1\n");
    } else
      printf("0\n");
  } else {
    long long ans = 0;
    while (!Q.empty()) {
      int r = Q.top();
      Q.pop();
      ans += (long long)1 * r * r;
    }
    cout << ans << endl;
  }
  return 0;
}
