#include <bits/stdc++.h>
using namespace std;
multiset<long long> s;
long long a[1003];
long long b[1003];
int main() {
  long long mx = 0;
  long long res = 0;
  int n, k1, k2;
  int k = 0;
  cin >> n >> k1 >> k2;
  k = k1 + k2;
  long long x, y;
  for (int i = 0; i < n; i++) {
    cin >> x;
    a[i] = x;
  }
  for (int i = 0; i < n; i++) {
    cin >> y;
    b[i] = y;
    s.insert(abs(a[i] - b[i]));
  }
  for (int i = 0; i < k; i++) {
    multiset<long long>::iterator it = s.end();
    it--;
    mx = *it;
    mx--;
    s.erase(it);
    s.insert(abs(mx));
  }
  multiset<long long>::iterator it = s.begin();
  for (int j = 0; j < n; j++) {
    res += (*it) * (*it);
    it++;
  }
  cout << res;
  return 0;
}
