#include <bits/stdc++.h>
using namespace std;
int dx[] = {0, 0, 1, 1, 1, -1, -1, -1};
int dy[] = {1, -1, 0, 1, -1, 0, 1, -1};
int main() {
  multiset<long long> st;
  int n;
  int k1, k2;
  int k;
  scanf("%d", &n);
  scanf("%d", &k1);
  scanf("%d", &k2);
  k = k1 + k2;
  vector<int> a(n), b(n);
  for (int i = 0; i < n; i++) scanf("%d", &a[i]);
  for (int i = 0; i < n; i++) scanf("%d", &b[i]);
  for (int i = 0; i < n; i++) st.insert(abs(a[i] - b[i]));
  while (k > 0) {
    k--;
    int x = *st.rbegin();
    st.erase(st.find(x));
    st.insert(abs(x - 1));
  }
  long long res = 0;
  for (multiset<long long>::iterator it = st.begin(); it != st.end(); it++)
    res += (*it) * (*it);
  cout << res;
  return 0;
}
