#include <bits/stdc++.h>
using namespace std;
long long a[200005];
deque<long long> Q;
int main() {
  long long n, k1, k2, k;
  cin >> n >> k1 >> k2;
  k = k1 + k2;
  for (int i = 0; i < n; i++) cin >> a[i];
  for (int i = 0; i < n; i++) {
    int b;
    cin >> b;
    Q.push_back(abs(a[i] - b));
  }
  while (k > 0) {
    sort(Q.rbegin(), Q.rend());
    int p = Q.front();
    Q.pop_front();
    Q.push_back(abs(p - 1));
    k--;
  }
  long long ans = 0;
  while (!Q.empty()) {
    ans += (Q.front() * Q.front());
    Q.pop_front();
  }
  cout << ans << endl;
  return 0;
}
