#include <bits/stdc++.h>
#pragma comment(linker, "/STACK:210886422")
using namespace std;
const int MOD = 1000000007;
const int INF = 1000000001;
const long double EPS = 1e-6;
const int HASH_POW = 29;
const long double PI = acos(-1.0);
mt19937_64 rnd(chrono::high_resolution_clock::now().time_since_epoch().count());
long long nextLong(long long l, long long r) {
  uniform_int_distribution<long long> foo(l, r);
  return foo(rnd);
}
double nextDouble(double l, double r) {
  uniform_real_distribution<double> foo(l, r);
  return foo(rnd);
}
double workTime() { return double(clock()) / CLOCKS_PER_SEC; }
void myReturn(int code = 0) { exit(code); }
int n, k1, k2, a[1010], b[1010];
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(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]);
  }
  priority_queue<int> Q;
  for (int i = 1; i <= n; ++i) {
    Q.push(abs(a[i] - b[i]));
  }
  for (int i = 0; i < k1 + k2; ++i) {
    int val = Q.top();
    Q.pop();
    if (val == 0) {
      val = 1;
    } else {
      --val;
    }
    Q.push(val);
  }
  long long ans = 0;
  while (!Q.empty()) {
    int val = Q.top();
    Q.pop();
    ans += val * 1ll * val;
  }
  printf("%lld\n", ans);
  myReturn();
}
