#include <bits/stdc++.h>
using namespace std;
struct cmp {
  bool operator()(long long &a, long long &b) { return a < b; }
};
long long a[1005], b[1005];
int n, k1, k2;
int main() {
  cin >> n >> k1 >> k2;
  for (int i = 0; i < n; i++) cin >> a[i];
  priority_queue<long long, vector<long long>, cmp> que;
  for (int i = 0; i < n; i++) {
    cin >> b[i];
    if (a[i] > b[i])
      que.push(a[i] - b[i]);
    else
      que.push(b[i] - a[i]);
  }
  int k = k1 + k2;
  while (k--) {
    long long tmp = que.top();
    que.pop();
    if (tmp > 0)
      tmp--;
    else
      tmp++;
    que.push(tmp);
  }
  long long ans = 0;
  while (!que.empty()) {
    long long tmp = que.top();
    que.pop();
    ans += tmp * tmp;
  }
  cout << ans;
  return 0;
}
