#include <bits/stdc++.h>
using namespace std;
const int N = 1010;
int a[N], b[N];
int n, k1, k2, k;
long long qmi(long long a, long long b) {
  long long ans = 1;
  for (; b; b >>= 1) {
    if (b & 1) ans = ans * a;
    a = a * a;
  }
  return ans;
}
int main() {
  scanf("%d%d%d", &n, &k1, &k2);
  k = k1 + k2;
  for (int i = 1; i <= n; i++) scanf("%d", &a[i]);
  for (int i = 1; i <= n; i++) scanf("%d", &b[i]);
  priority_queue<int> q;
  for (int i = 1; i <= n; i++) q.push(abs(a[i] - b[i]));
  while (k--) {
    int tmp = q.top();
    q.pop();
    q.push(abs(tmp - 1));
  }
  long long ans = 0;
  while (q.size()) {
    ans += qmi((long long)q.top(), 2);
    q.pop();
  }
  printf("%I64d\n", ans);
  return 0;
}
