You are given two arrays A and B, each of size n. The error, E, between these two arrays is defined <image>. You have to perform exactly k1 operations on array A and exactly k2 operations on array B. In one operation, you have to choose one element of the array and increase or decrease it by 1.

Output the minimum possible value of error after k1 operations on array A and k2 operations on array B have been performed.

Input

The first line contains three space-separated integers n (1 ≤ n ≤ 103), k1 and k2 (0 ≤ k1 + k2 ≤ 103, k1 and k2 are non-negative) — size of arrays and number of operations to perform on A and B respectively.

Second line contains n space separated integers a1, a2, ..., an ( - 106 ≤ ai ≤ 106) — array A.

Third line contains n space separated integers b1, b2, ..., bn ( - 106 ≤ bi ≤ 106)— array B.

Output

Output a single integer — the minimum possible value of <image> after doing exactly k1 operations on array A and exactly k2 operations on array B.

Examples

Input

2 0 0
1 2
2 3


Output

2

Input

2 1 0
1 2
2 2


Output

0

Input

2 5 7
3 4
14 4


Output

1

Note

In the first sample case, we cannot perform any operations on A or B. Therefore the minimum possible error E = (1 - 2)2 + (2 - 3)2 = 2. 

In the second sample case, we are required to perform exactly one operation on A. In order to minimize error, we increment the first element of A by 1. Now, A = [2, 2]. The error is now E = (2 - 2)2 + (2 - 2)2 = 0. This is the minimum possible error obtainable.

In the third sample case, we can increase the first element of A to 8, using the all of the 5 moves available to us. Also, the first element of B can be reduced to 8 using the 6 of the 7 available moves. Now A = [8, 4] and B = [8, 4]. The error is now E = (8 - 8)2 + (4 - 4)2 = 0, but we are still left with 1 move for array B. Increasing the second element of B to 5 using the left move, we get B = [8, 5] and E = (8 - 8)2 + (4 - 5)2 = 1.
#include <bits/stdc++.h>
using namespace std;
template <typename T>
class ComparisonOperators {
  friend bool operator==(T const& lhs, T const& rhs) {
    return lhs.compare(rhs) == 0;
  }
  friend bool operator!=(T const& lhs, T const& rhs) {
    return lhs.compare(rhs) != 0;
  }
  friend bool operator<(T const& lhs, T const& rhs) {
    return lhs.compare(rhs) < 0;
  }
  friend bool operator>(T const& lhs, T const& rhs) {
    return rhs.compare(lhs) < 0;
  }
  friend bool operator<=(T const& lhs, T const& rhs) {
    bool result = lhs.compare(rhs) <= 0;
    return result;
  }
  friend bool operator>=(T const& lhs, T const& rhs) {
    return rhs.compare(lhs) <= 0;
  }
};
class lint : ComparisonOperators<lint> {
 public:
  explicit lint(std::string number);
  lint();
  lint(long long number);
  lint(int number);
  lint(double number);
  lint(vector<int> nums, bool is_neg);
  lint(const lint& obj);
  int get_length() const;
  bool is_negative_number() const;
  lint& operator+=(const lint& b);
  lint& operator-=(const lint& b);
  lint& operator*=(const lint& number2);
  lint& operator/=(const lint& b);
  explicit operator bool() const;
  explicit operator int();
  lint operator+() const;
  lint operator-() const;
  int operator[](size_t index) const;
  lint& operator=(const lint& other);
  lint& operator++();
  lint operator++(int);
  lint& operator--();
  lint operator--(int);
  bool cmp(lint const& rhs) const;
  int compare(lint const& rhs) const;
  bool is_zero() const;
  std::string to_string();

 private:
  bool is_negative;
  vector<int> numbers;
  lint abs(lint number) const;
  vector<int> reverse_numbers(vector<int> const& numbers) const;
  void make_equal_length(const lint& b, vector<int>& number1,
                         vector<int>& number2) const;
  void string_to_vector(std::string const& number);
  void integer_to_vector(long long a);
};
lint abs(lint number);
lint pow(lint a, int n);
std::ostream& operator<<(std::ostream& os, const lint& obj);
std::istream& operator>>(std::istream& is, lint& obj);
lint operator+(const lint& lhs, const lint& rhs);
lint operator-(const lint& lhs, const lint& rhs);
lint operator*(const lint& lhs, const lint& rhs);
lint operator/(const lint& lhs, const lint& rhs);
lint::lint(std::string number) { string_to_vector(number); }
lint::lint() { integer_to_vector(0); }
lint::lint(long long number) { integer_to_vector(number); }
lint::lint(int number) { integer_to_vector(static_cast<long long>(number)); }
lint::lint(double number) {
  std::string str = std::to_string(std::trunc(number));
  std::string result = str.substr(0, str.size() - 7);
  string_to_vector(result);
}
lint::lint(vector<int> nums, bool is_neg) {
  numbers = nums;
  is_negative = is_neg;
}
lint::lint(const lint& obj) {
  is_negative = obj.is_negative_number();
  for (int t : obj.numbers) {
    numbers.push_back(t);
  }
}
int lint::get_length() const { return numbers.size(); }
bool lint::is_negative_number() const { return is_negative; }
lint& lint::operator+=(const lint& b) {
  if (!is_negative_number() && b.is_negative_number()) {
    lint temp(b);
    temp = abs(temp);
    return operator-=(temp);
  }
  if (is_negative_number() && !b.is_negative_number()) {
    lint temp_this = lint(*this);
    temp_this.is_negative = false;
    lint temp = lint(b);
    temp -= temp_this;
    *this = temp;
    return *this;
  }
  vector<int> number1;
  vector<int> number2;
  make_equal_length(b, number1, number2);
  vector<int> result;
  int rest = 0;
  for (int i = number1.size() - 1; i >= 0; --i) {
    int sum = number1[i] + number2[i] + rest;
    if (sum > 9) {
      rest = 1;
      sum -= 10;
    } else {
      rest = 0;
    }
    result.push_back(sum);
  }
  if (rest > 0) {
    result.push_back(rest);
  }
  vector<int> reverse_result = reverse_numbers(result);
  (*this).numbers = reverse_result;
  return *this;
}
lint& lint::operator-=(const lint& b) {
  if (!is_negative_number() && b.is_negative_number()) {
    return (*this).operator+=(abs(b));
  }
  if (is_negative_number() && !b.is_negative_number()) {
    lint temp(b);
    temp.is_negative = true;
    return (*this).operator+=(temp);
  }
  vector<int> number1;
  vector<int> number2;
  make_equal_length(b, number1, number2);
  int is_number1_more_than_number2 = 0;
  for (unsigned int i = 0; i < number1.size(); ++i) {
    if (number1[i] > number2[i]) {
      is_number1_more_than_number2 = 1;
      break;
    } else if (number1[i] < number2[i]) {
      is_number1_more_than_number2 = 2;
      break;
    }
  }
  if (is_number1_more_than_number2 == 0) {
    vector<int> t;
    t.push_back(0);
    numbers = t;
    return *this;
  }
  vector<int> result;
  if (is_number1_more_than_number2 == 1) {
    for (int i = number1.size() - 1; i >= 0; --i) {
      if (number1[i] < number2[i]) {
        number1[i] += 10;
        number1[i - 1] -= 1;
      }
      int r = number1[i] - number2[i];
      result.push_back(r);
    }
  } else if (is_number1_more_than_number2 == 2) {
    for (int i = number2.size() - 1; i >= 0; --i) {
      if (number2[i] < number1[i]) {
        number2[i] += 10;
        number2[i - 1] -= 1;
      }
      int r = number2[i] - number1[i];
      result.push_back(r);
    }
  }
  bool can_copy = false;
  vector<int> result_without_zero;
  for (int i = result.size() - 1; i >= 0; --i) {
    if (result[i] != 0) {
      can_copy = true;
    }
    if (can_copy) {
      result_without_zero.push_back(result[i]);
    }
  }
  (*this).numbers = result_without_zero;
  if (!is_negative_number() && !b.is_negative_number()) {
    if (is_number1_more_than_number2 == 2) {
      is_negative = true;
    }
  }
  if (is_negative_number() && b.is_negative_number()) {
    if (is_number1_more_than_number2 == 2) {
      is_negative = false;
    }
  }
  return *this;
}
lint& lint::operator*=(const lint& number2) {
  vector<int> a = reverse_numbers(numbers);
  vector<int> b = reverse_numbers(number2.numbers);
  vector<int> c(a.size() + b.size(), 0);
  for (size_t i = 0; i < a.size(); ++i) {
    int carry = 0;
    for (unsigned int j = 0; j < b.size() || carry; ++j) {
      long long cur = c[i + j] + a[i] * 1ll * (j < b.size() ? b[j] : 0) + carry;
      c[i + j] = int(cur % 10);
      carry = int(cur / 10);
    }
  }
  while (c.size() > 1 && c.back() == 0) {
    c.pop_back();
  }
  vector<int> result = reverse_numbers(c);
  numbers = result;
  if (is_negative_number() && !number2.is_negative_number()) {
    is_negative = true;
  } else if (!is_negative_number() && number2.is_negative_number()) {
    is_negative = true;
  } else {
    is_negative = false;
  }
  return *this;
}
lint& lint::operator/=(const lint& number2) {
  if (number2.is_zero()) {
    int d = 4 - 4;
    int a = 4 / d;
    numbers.push_back(a);
  }
  if (is_zero()) {
    vector<int> temp;
    temp.push_back(0);
    numbers = temp;
    is_negative = false;
    return *this;
  }
  bool second_number_more_then_first_number = abs(*this).cmp(abs(number2));
  if (second_number_more_then_first_number) {
    vector<int> temp;
    temp.push_back(0);
    numbers = temp;
    is_negative = false;
    return *this;
  }
  vector<int> res;
  for (int i = (*this).get_length() - 1; i >= 0; --i) {
    res.push_back(0);
  }
  lint current_value(0);
  for (int i = 0; i < (*this).get_length(); ++i) {
    current_value = current_value * 10;
    current_value.numbers[current_value.get_length() - 1] = (*this).numbers[i];
    int x = 0;
    int left_index = 0;
    int right_index = 10;
    while (left_index <= right_index) {
      int middle = (left_index + right_index) >> 1;
      lint cur = abs(number2) * middle;
      if (abs(cur) <= abs(current_value)) {
        x = middle;
        left_index = middle + 1;
      } else {
        right_index = middle - 1;
      }
    }
    res[i] = x;
    current_value = current_value - abs(number2) * x;
  }
  res = reverse_numbers(res);
  while (res.size() > 1 && res.back() == 0) {
    res.pop_back();
  }
  res = reverse_numbers(res);
  numbers = res;
  if (is_negative_number() && !number2.is_negative_number()) {
    is_negative = true;
  } else if (!is_negative_number() && number2.is_negative_number()) {
    is_negative = true;
  } else {
    is_negative = false;
  }
  return *this;
}
lint::operator bool() const { return !is_zero(); }
lint::operator int() { return std::stoi((*this).to_string()); }
lint lint::operator+() const {
  lint temp(*this);
  return temp;
}
lint lint::operator-() const {
  lint temp(*this);
  if (is_negative_number()) {
    temp.is_negative = false;
  } else {
    temp.is_negative = true;
  }
  return temp;
}
int lint::operator[](size_t index) const { return numbers[index]; }
lint& lint::operator=(const lint& other) {
  if (this != &other) {
    numbers = other.numbers;
    is_negative = other.is_negative_number();
  }
  return *this;
}
lint& lint::operator++() {
  lint one(1);
  (*this) += one;
  return *this;
}
lint lint::operator++(int) {
  lint tmp(*this);
  operator++();
  return tmp;
}
lint& lint::operator--() {
  lint one(1);
  (*this) -= one;
  return *this;
}
lint lint::operator--(int) {
  lint tmp(*this);
  operator--();
  return tmp;
}
bool lint::cmp(lint const& rhs) const {
  if (is_negative_number() && !rhs.is_negative_number()) {
    return true;
  }
  if (!is_negative_number() && rhs.is_negative_number()) {
    return false;
  }
  if (get_length() < rhs.get_length()) {
    return true;
  }
  if (get_length() > rhs.get_length()) {
    return false;
  }
  for (int i = 0; i < get_length(); ++i) {
    if (numbers[i] < rhs[i]) {
      if (is_negative_number()) {
        return false;
      }
      return true;
    } else if (numbers[i] > rhs[i]) {
      if (is_negative_number()) {
        return true;
      }
      return false;
    }
  }
  return false;
}
int lint::compare(lint const& rhs) const {
  if ((*this).cmp(rhs)) {
    return -1;
  } else if (rhs.cmp(*this)) {
    return 1;
  } else {
    return 0;
  }
}
lint lint::abs(lint number) const {
  number.is_negative = false;
  return number;
}
bool lint::is_zero() const {
  if (numbers.size() == 1 && numbers[0] == 0) {
    return true;
  }
  return false;
}
std::string int_to_string(int i) {
  std::stringstream ss;
  std::string s;
  ss << i;
  s = ss.str();
  return s;
}
std::string lint::to_string() {
  std::string result = "";
  if (is_negative_number() && !is_zero()) {
    result += "-";
  }
  for (int i = 0; i < get_length(); ++i) {
    int a = (*this)[i];
    result += int_to_string(a);
  }
  return result;
}
vector<int> lint::reverse_numbers(vector<int> const& numbers) const {
  vector<int> reverse_result;
  for (int i = numbers.size() - 1; i >= 0; --i) {
    reverse_result.push_back(numbers[i]);
  }
  return reverse_result;
}
void lint::make_equal_length(lint const& b, vector<int>& number1,
                             vector<int>& number2) const {
  int diff_length = get_length() - b.get_length();
  if (diff_length > 0) {
    number1 = (*this).numbers;
    for (int i = 0; i < diff_length; ++i) {
      number2.push_back(0);
    }
    for (int i = 0; i < b.get_length(); ++i) {
      number2.push_back(b[i]);
    }
  } else if (diff_length < 0) {
    for (int i = 0; i < b.get_length(); ++i) {
      number2.push_back(b[i]);
    }
    for (int i = 0; i < (diff_length * (-1)); ++i) {
      number1.push_back(0);
    }
    for (int i = 0; i < get_length(); ++i) {
      number1.push_back((*this)[i]);
    }
  } else {
    for (int i = 0; i < b.get_length(); ++i) {
      number1.push_back((*this)[i]);
      number2.push_back(b[i]);
    }
  }
}
void lint::string_to_vector(std::string const& number) {
  unsigned int from = 0;
  if (number[0] == '-') {
    is_negative = true;
    from = 1;
  } else {
    is_negative = false;
  }
  for (unsigned int i = from; i < number.length(); ++i) {
    int ia = number[i] - '0';
    numbers.push_back(ia);
  }
}
void lint::integer_to_vector(long long a) {
  if (a < 0) {
    is_negative = true;
    a = (-1) * a;
  } else {
    is_negative = false;
  }
  if (a == 0) {
    numbers.push_back(0);
  }
  vector<int> temp;
  while (a) {
    int x = a % 10;
    a /= 10;
    temp.push_back(x);
  }
  for (int i = temp.size() - 1; i >= 0; --i) {
    numbers.push_back(temp[i]);
  }
}
lint abs(lint number) {
  lint n(number);
  lint zero(0);
  bool is_less = n.cmp(zero);
  if (is_less) {
    n *= lint(-1);
  }
  return n;
}
lint pow(lint a, int n) {
  lint res(1);
  while (n) {
    if (n & 1) {
      res *= a;
    }
    a *= a;
    n >>= 1;
  }
  return res;
}
std::ostream& operator<<(std::ostream& os, const lint& obj) {
  if (obj.is_negative_number()) {
    os << "-";
  }
  for (int i = 0; i < obj.get_length(); ++i) {
    os << obj[i];
  }
  return os;
}
std::istream& operator>>(std::istream& is, lint& obj) {
  bool is_lead_zeros = true;
  bool is_negative = false;
  vector<int> numbers;
  while (is.good()) {
    char c = static_cast<char>(is.get());
    int ic = c - '0';
    if (c == '\n') {
      break;
    }
    if (c == EOF) {
      break;
    }
    if (c == '\0') {
      break;
    }
    if (is.good()) {
      if (c == '-') {
        is_negative = true;
      } else if (c == '+') {
        is_negative = false;
      } else if (ic == 0 && is_lead_zeros) {
      } else {
        numbers.push_back(ic);
        is_lead_zeros = false;
      }
    }
  }
  lint temp(numbers, is_negative);
  obj = temp;
  return is;
}
lint operator+(const lint& lhs, const lint& rhs) {
  lint temp(lhs);
  return temp += rhs;
}
lint operator-(const lint& lhs, const lint& rhs) {
  lint temp(lhs);
  return temp -= rhs;
}
lint operator*(const lint& lhs, const lint& rhs) {
  lint temp(lhs);
  return temp *= rhs;
}
lint operator/(const lint& lhs, const lint& rhs) {
  lint temp(lhs);
  return temp /= rhs;
}
int inf = 2000000000;
template <typename t>
t gcd(t a, t b) {
  return (!b) ? a : gcd(b, a % b);
}
template <typename t>
t pow(t a, t b) {
  if (b == 0) return 1;
  t cur = pow(a, b / 2);
  if (b % 2 == 0)
    return cur * cur;
  else
    return cur * cur * a;
}
template <typename t>
bool isOk(t x, t y, t boundX, t boundY) {
  return ((x >= 0) && (y >= 0) && (x < boundX) && (y < boundY));
}
int dx[] = {0, 0, 1, -1};
int dy[] = {1, -1, 0, 0};
vector<int> g[300001];
bool was[300001];
void dfs(int v) {
  if (was[v]) return;
  was[v] = 1;
  for (int i = 0; i < g[v].size(); ++i) {
    dfs(g[v][i]);
  }
}
double square(vector<pair<double, double>> nodes) {
  double area = 0;
  int numPoints = nodes.size();
  int j = numPoints - 1;
  for (int i = 0; i < numPoints; i++) {
    area = area + (nodes[j].first + nodes[i].first) *
                      (nodes[j].second - nodes[i].second);
    j = i;
  }
  return area / 2;
}
int calcMap(map<int, int> m) {
  int sum = 0;
  for (auto i : m) {
    sum += i.second;
  }
  return sum;
}
struct PointF {
  double X;
  double Y;
  PointF(double x, double y) {
    X = x;
    Y = y;
  }
};
struct wall {
  int x1;
  int y1;
  int x2;
  int y2;
};
vector<int> a, b, dif;
int opa, opb;
multiset<int> seta;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  int n;
  cin >> n;
  cin >> opa >> opb;
  for (int i = 0; i < n; ++i) {
    int t;
    cin >> t;
    a.push_back(t);
  }
  for (int i = 0; i < n; ++i) {
    int t;
    cin >> t;
    b.push_back(t);
  }
  for (int i = 0; i < n; ++i) {
    dif.push_back(abs(a[i] - b[i]));
    seta.insert(abs(a[i] - b[i]));
  }
  int oper = opa + opb;
  while (oper) {
    --oper;
    int t = *seta.rbegin();
    if (t > 0) {
      seta.erase(seta.find(t));
      seta.insert(t - 1);
    } else {
      seta.insert(1);
    }
  }
  lint res = 0;
  for (auto i : seta) {
    res += (long long)i * i;
  }
  cout << res;
  return 0;
}
