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