#include <bits/stdc++.h>
using namespace std;
const int MAXN = 1e5;
int a[MAXN + 1];
int b[MAXN + 1];
int main() {
  ios::sync_with_stdio(false);
  int i, n, k1, k2, tmp, k;
  long long res = 0;
  priority_queue<long long> pq;
  cin >> n >> k1 >> k2;
  k = k1 + k2;
  for (i = 0; i < n; i++) cin >> a[i];
  for (i = 0; i < n; i++) {
    cin >> b[i];
    pq.push(abs(a[i] - b[i]));
  }
  while (k--) {
    tmp = pq.top();
    pq.pop();
    pq.push(abs(tmp - 1));
  }
  while (!pq.empty()) {
    res += pq.top() * pq.top();
    pq.pop();
  }
  cout << res << endl;
}
