#include <bits/stdc++.h>
using namespace std;
priority_queue<long long> P;
long long abs1(long long x) {
  if (x < 0) return -x;
  return x;
}
long long xx[1002], yy[1002];
int main() {
  int n;
  long long x, y;
  scanf("%d%I64d%I64d", &n, &x, &y);
  int T = x + y;
  for (int i = 1; i <= n; i++) scanf("%I64d", &xx[i]);
  for (int i = 1; i <= n; i++) scanf("%I64d", &yy[i]);
  for (int i = 1; i <= n; i++) P.push(abs1(xx[i] - yy[i]));
  while (T--) {
    long long v = P.top();
    P.pop();
    v--;
    P.push(abs1(v));
  }
  long long ans = 0;
  while (!P.empty()) ans += P.top() * P.top(), P.pop();
  printf("%I64d\n", ans);
  return 0;
}
