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