#include <bits/stdc++.h>
using namespace std;
long long int n, k1, k2, A[1005], flag, B[1005], D[1005], tut, cev, t;
priority_queue<long long int> q;
int main() {
  scanf("%lld %lld %lld", &n, &k1, &k2);
  for (int i = 1; i <= n; i++) scanf("%lld", &A[i]);
  for (int i = 1; i <= n; i++) scanf("%lld", &B[i]);
  for (int i = 1; i <= n; i++) D[i] = abs(A[i] - B[i]);
  for (int i = 1; i <= n; i++) q.push(D[i]);
  for (int i = 1; i <= k1 + k2; i++) {
    if (q.top() == 0) {
      tut = k1 + k2 - i + 1;
      flag = 1;
      break;
    }
    long long int ggwp = q.top() - 1;
    q.pop();
    q.push(ggwp);
  }
  if (flag == 1) {
    if (tut % 2 == 0)
      printf("0");
    else
      printf("1");
    return 0;
  }
  while (!q.empty()) {
    t = q.top();
    t = t * t;
    cev += t;
    q.pop();
  }
  printf("%lld", cev);
  return 0;
}
