#include <bits/stdc++.h>
using namespace std;
long long a[1005], b[1005];
priority_queue<int> q;
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  int n, k1, k2;
  while (cin >> n >> k1 >> k2) {
    for (int i = 1; i <= n; i++) {
      cin >> a[i];
    }
    for (int i = 1; i <= n; i++) {
      cin >> b[i];
    }
    for (int i = 1; i <= n; i++) {
      q.push(abs(a[i] - b[i]));
    }
    for (int i = 1; i <= k1 + k2; i++) {
      long long p = q.top();
      q.pop();
      if (p == 0) {
        p++;
      } else
        p--;
      q.push(p);
    }
    long long result = 0;
    while (!q.empty()) {
      long long p = q.top();
      result += p * p;
      q.pop();
    }
    cout << result << endl;
  }
  return 0;
}
