#include <bits/stdc++.h>
using namespace std;
const long long sz = 1e3 + 5;
long long a[sz], b[sz], c[sz];
multiset<long long> ms;
signed main() {
  long long n, k1, k2;
  cin >> n >> k1 >> k2;
  for (long long i = 0; i < n; ++i) cin >> a[i];
  for (long long i = 0; i < n; ++i) cin >> b[i];
  for (long long i = 0; i < n; ++i) {
    c[i] = (long long)abs(a[i] - b[i]);
  }
  sort(c, c + n);
  for (long long i = 0; i < n; ++i) {
    ms.insert(c[i]);
  }
  for (long long i = 0; i < k1 + k2; ++i) {
    long long mx = -1, idx = -1;
    for (long long j = 0; j < n; ++j) {
      if (c[j] > mx) {
        idx = j;
        mx = c[j];
      }
    }
    c[idx] = (long long)(abs(c[idx] - 1));
  }
  long long ans = 0;
  for (long long i = 0; i < n; ++i) {
    ans += c[i] * c[i];
  }
  cout << ans;
}
