#include <bits/stdc++.h>
using namespace std;
const int sz = 1e5, m = 1e9 + 9;
long long a[sz], b[sz], d[sz];
int main() {
  long long i, j, x, y, z, n, k, q, w, c, f, ans;
  cin >> n >> q >> w;
  k = q + w;
  for (i = 0; i < n; i++) scanf("%I64d", &a[i]);
  for (i = 0; i < n; i++) {
    scanf("%I64d", &b[i]);
    d[i] = abs(a[i] - b[i]);
  }
  sort(d, d + n);
  c = 0;
  f = 0;
  ans = 0;
  for (i = 1; i <= n; i++) {
    x = n - i;
    if (x > 0)
      y = d[x] - d[x - 1];
    else
      y = d[0];
    if (c + y * i <= k) {
      c += y * i;
    } else {
      f = x;
      z = k - c;
      y = z / i;
      z = z % i;
      ans += z * (d[x] - y - 1) * (d[x] - y - 1);
      ans += (i - z) * (d[x] - y) * (d[x] - y);
      c = k;
      break;
    }
  }
  if (c != k) {
    c = k - c;
    if (c % 2 == 1) ans++;
  }
  if (i > n) f = 0;
  for (i = 0; i < f; i++) {
    ans += d[i] * d[i];
  }
  printf("%I64d\n", ans);
}
