#include <bits/stdc++.h>
using namespace std;
long long n, k1, k2;
long long sum;
vector<pair<long long, long long> > a;
bool comp(pair<long long, long long> a, pair<long long, long long> b) {
  return abs(a.first - a.second) > abs(b.first - b.second);
}
int main() {
  cin >> n >> k1 >> k2;
  a.resize(n);
  for (long long i = 0; i < n; ++i) cin >> a[i].first;
  for (long long i = 0; i < n; ++i) cin >> a[i].second;
  sort(a.begin(), a.end(), comp);
  for (long long i = 0; i < k1; ++i) {
    if (a[0].first > a[0].second)
      --a[0].first;
    else
      ++a[0].first;
    sort(a.begin(), a.end(), comp);
  }
  for (long long i = 0; i < k2; ++i) {
    if (a[0].first > a[0].second)
      ++a[0].second;
    else
      --a[0].second;
    sort(a.begin(), a.end(), comp);
  }
  for (long long i = 0; i < n; ++i)
    sum += (a[i].second - a[i].first) * (a[i].second - a[i].first);
  cout << sum;
  return 0;
}
