#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  long long n, k1, k2;
  cin >> n >> k1 >> k2;
  long long a[n];
  for (int i = 0; i < n; i++) cin >> a[i];
  long long b[n];
  for (int i = 0; i < n; i++) cin >> b[i];
  priority_queue<long long> diff;
  for (int i = 0; i < n; i++) {
    diff.push(abs(a[i] - b[i]));
  }
  for (int i = 0; i < k1 + k2; i++) {
    long long x = diff.top();
    diff.pop();
    if (x == 0)
      diff.push(x + 1);
    else
      diff.push(x - 1);
  }
  long long ans = 0;
  while (!diff.empty()) {
    long long x = diff.top();
    diff.pop();
    ans += x * x;
  }
  cout << ans << endl;
  return 0;
}
