#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, k1, k2;
  cin >> n >> k1 >> k2;
  k1 += k2;
  long long *a1 = new long long[n];
  long long *a2 = new long long[n];
  for (int i = 0; i < n; ++i) cin >> a1[i];
  for (int i = 0; i < n; ++i) cin >> a2[i], a1[i] -= a2[i];
  for (int i = 0; i < k1; ++i) {
    int val = -1, idx = -1;
    for (int j = 0; j < n; ++j)
      if (abs(a1[j]) > val) {
        val = abs(a1[j]);
        idx = j;
      }
    a1[idx] > 0 ? --a1[idx] : ++a1[idx];
  }
  long long res = 0;
  for (int i = 0; i < n; ++i) res += pow(a1[i], 2);
  cout << res << endl;
  delete[] a1;
  delete[] a2;
  return 0;
}
