#include <bits/stdc++.h>
using namespace std;
const int maxN = 1010;
int n, k1, k2, oper;
long long a[maxN], b[maxN], temp, result = 0;
priority_queue<long long> diff;
int i;
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  cin >> n >> k1 >> k2;
  for (i = 0; i < n; i++) {
    cin >> a[i];
  }
  for (i = 0; i < n; i++) {
    cin >> b[i];
    diff.push(abs(b[i] - a[i]));
  }
  oper = k1 + k2;
  while (oper > 0) {
    temp = diff.top();
    diff.pop();
    diff.push(abs(temp - 1));
    oper--;
  }
  while (!diff.empty()) {
    temp = diff.top();
    diff.pop();
    result += temp * temp;
  }
  cout << result << endl;
  return 0;
}
