#include <bits/stdc++.h>
using namespace std;
int main() {
  long long n, k1, k2;
  cin >> n >> k1 >> k2;
  long long a[n + 10], b[n + 10];
  for (long long i = 1; i <= n; i++) cin >> a[i];
  for (long long i = 1; i <= n; i++) cin >> b[i];
  long long dif[n + 10];
  for (long long i = 1; i <= n; i++) {
    dif[i] = abs(a[i] - b[i]);
  }
  for (long long i = 1; i <= n; i++) {
    for (long long j = i + 1; j <= n; j++) {
      if (dif[i] < dif[j]) {
        swap(dif[i], dif[j]);
        swap(a[i], a[j]);
        swap(b[i], b[j]);
      }
    }
  }
  long long tot = (k1 + k2);
  while (tot--) {
    long long maxx = -100000000000000, ind = 0;
    for (long long i = 1; i <= n; i++) {
      if (dif[i] > maxx) {
        ind = i;
        maxx = dif[i];
      }
    }
    dif[ind]--;
    if (maxx == 0) {
      for (int i = 1; i <= n; i++) {
        if (dif[i] < 0) dif[i] *= (-1);
      }
    }
  }
  long long sum = 0;
  for (long long i = 1; i <= n; i++) {
    sum += (dif[i] * dif[i]);
  }
  cout << sum << endl;
}
