#include <bits/stdc++.h>
using namespace std;
const int maxn = 1002;
int n, k1, k2, a[maxn], b[maxn], L[maxn];
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cin >> n >> k1 >> k2;
  for (int i = 1; i <= n; ++i) cin >> a[i];
  for (int i = 1; i <= n; ++i) cin >> b[i];
  for (int i = 1; i <= n; ++i) L[i] = abs(a[i] - b[i]);
  for (int t = 1; t <= k1 + k2; ++t) {
    int pos = 0;
    for (int i = 1; i <= n; ++i) {
      if (pos == 0 || L[i] > L[pos]) pos = i;
    }
    if (L[pos] == 0)
      ++L[pos];
    else
      L[pos]--;
  }
  int64_t res = 0;
  for (int i = 1; i <= n; ++i) res += 1LL * L[i] * L[i];
  cout << res;
}
