#include <bits/stdc++.h>
using namespace std;
bool f(long long a, long long b) { return a > b; }
int main() {
  long long n, k1, k2, ks;
  vector<long long> A, B, R;
  cin >> n >> k1 >> k2;
  ks = k1 + k2;
  for (int i = 0; i < n; ++i) {
    long long aux;
    cin >> aux;
    A.push_back(aux);
  }
  for (int i = 0; i < n; ++i) {
    long long aux;
    cin >> aux;
    B.push_back(aux);
  }
  for (int i = 0; i < n; ++i) {
    R.push_back(std::abs(A[i] - B[i]));
  }
  std::sort(R.begin(), R.end(), f);
  while (ks != 0) {
    auto it = std::max_element(R.begin(), R.end());
    if (*it != 0) {
      *it -= 1;
    } else {
      *it += 1;
    }
    ks--;
  }
  long long sum = 0;
  for (int i = 0; i < n; ++i) {
    sum += R[i] * R[i];
  }
  cout << sum;
}
