#include <bits/stdc++.h>
using namespace std;
const int N = 1001;
int n, k1, k2;
int a[N], b[N];
priority_queue<int> q;
int ABS(int x) { return x > 0 ? x : -x; }
int main() {
  long long ans = 0;
  scanf("%d%d%d", &n, &k1, &k2);
  for (int i = 1; i <= n; i++) scanf("%d", &a[i]);
  for (int i = 1; i <= n; i++) scanf("%d", &b[i]);
  for (int i = 1; i <= n; i++) q.push(ABS(a[i] - b[i]));
  for (int i = 1; i <= k1 + k2; i++) {
    int u = q.top();
    q.pop();
    q.push(ABS(u - 1));
  }
  while (!q.empty()) {
    int u = q.top();
    q.pop();
    ans += 1ll * u * u;
  }
  printf("%lld\n", ans);
  return 0;
}
