#include <bits/stdc++.h>
using namespace std;
int main() {
  long long n, k1, k2, s = 0;
  scanf("%lld %lld %lld", &n, &k1, &k2);
  long long k = k1 + k2;
  vector<long long> a(n), b(n);
  multiset<long long> c;
  for (long long i = 0; i < n; i++) {
    scanf("%lld", &a[i]);
  }
  for (long long i = 0; i < n; i++) {
    scanf("%lld", &b[i]);
  }
  for (long long i = 0; i < n; i++) {
    c.insert(abs(a[i] - b[i]));
  }
  auto i = c.end();
  i--;
  long long m = *i;
  while (m != 0 && k != 0) {
    k--;
    c.erase(i);
    m--;
    c.insert(m);
    i = c.end();
    i--;
    m = *i;
  }
  k = k % 2;
  for (auto i = c.begin(); i != c.end(); i++) {
    s += (*i) * (*i);
  }
  s += k;
  printf("%lld", s);
  return 0;
}
