#include <bits/stdc++.h>
using namespace std;
int main() {
  long long n, k1, k2;
  cin >> n >> k1 >> k2;
  long long a[n], b[n];
  priority_queue<long long> pq;
  for (int i = 0; i < n; i++) {
    cin >> a[i];
  }
  for (int i = 0; i < n; i++) {
    cin >> b[i];
    pq.push(abs(a[i] - b[i]));
  }
  long long k = k1 + k2;
  while (k--) {
    long long p = pq.top();
    pq.pop();
    if (p == 0)
      p++;
    else
      p--;
    pq.push(p);
  }
  long long sum = 0;
  while (!pq.empty()) {
    long long p = pq.top();
    sum += (p * p);
    pq.pop();
  }
  cout << sum;
}
