#include <bits/stdc++.h>
using namespace std;
long long max(long long a, long long b) { return a > b ? a : b; }
long long min(long long a, long long b) { return a < b ? a : b; }
double max(double a, double b) { return a > b ? a : b; }
double min(double a, double b) { return a < b ? a : b; }
long long modd(long long a) {
  if (a < 0LL) return a * -1LL;
  return a;
}
double modd(double a) {
  if (a < 0.0) return a * -1.0;
  return a;
}
long long modulo(long long a) { return a % 1000000007LL; }
long long power(long long k, long long p) {
  if (p == 0) return 1LL;
  long long P = power(k, p / 2LL);
  P = (P * P) % 1000000007LL;
  if (p % 2 == 1) P = (P * k) % 1000000007LL;
  return P;
}
long long q = 0;
long long cc = 0;
void _merge(char arr[], long long low, long long mid, long long high) {
  long long n = high - low + 1;
  char res[n];
  long long left = low;
  long long right = mid + 1;
  char ans;
  long long itr = 0;
  while (left <= mid && right <= high) {
    if (cc == q) {
      exit(0);
    }
    cout << "? " << arr[left] << " " << arr[right] << endl;
    fflush(stdout);
    cc++;
    cin >> ans;
    if (ans == '<') {
      res[itr++] = arr[left++];
    } else {
      res[itr++] = arr[right++];
    }
  }
  while (left <= mid) {
    res[itr++] = arr[left++];
  }
  while (right <= high) {
    res[itr++] = arr[right++];
  }
  for (long long i = 0; i < n; i++) {
    arr[i + low] = res[i];
  }
}
void _sort(char arr[], long long low, long long high) {
  if (low >= high) {
    return;
  }
  long long mid = (low + high) / 2;
  _sort(arr, low, mid);
  _sort(arr, mid + 1, high);
  _merge(arr, low, mid, high);
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  long long n;
  cin >> n;
  long long a[n];
  for (long long i = 0; i < n; i++) {
    cin >> a[i];
  }
  long long b[n];
  for (long long i = 0; i < n; i++) {
    cin >> b[i];
  }
  vector<long long> c(n);
  for (long long i = 0; i < n; i++) {
    c[i] = a[i] - b[i];
  }
  sort(c.begin(), c.end());
  long long ans = 0;
  for (long long i = 0; i < n; i++) {
    if (c[i] <= 0) {
      continue;
    }
    long long elem = (c[i] * -1) + 1;
    long long elem_pos = lower_bound(c.begin(), c.end(), elem) - c.begin();
    ans += i - elem_pos;
  }
  cout << ans << endl;
  return 0;
}

### Prompt

Generate a CPP solution to the following problem:

The next lecture in a high school requires two topics to be discussed. The i-th topic is interesting by a_i units for the teacher and by b_i units for the students.

The pair of topics i and j (i < j) is called good if a_i + a_j > b_i + b_j (i.e. it is more interesting for the teacher).

Your task is to find the number of good pairs of topics.

Input

The first line of the input contains one integer n (2 ≤ n ≤ 2 ⋅ 10^5) — the number of topics.

The second line of the input contains n integers a_1, a_2, ..., a_n (1 ≤ a_i ≤ 10^9), where a_i is the interestingness of the i-th topic for the teacher.

The third line of the input contains n integers b_1, b_2, ..., b_n (1 ≤ b_i ≤ 10^9), where b_i is the interestingness of the i-th topic for the students.

Output

Print one integer — the number of good pairs of topic.

Examples

Input


5
4 8 2 6 2
4 5 4 1 3


Output


7


Input


4
1 3 2 4
1 3 2 4


Output


0

### Response

```cpp
#include <bits/stdc++.h>
using namespace std;
long long max(long long a, long long b) { return a > b ? a : b; }
long long min(long long a, long long b) { return a < b ? a : b; }
double max(double a, double b) { return a > b ? a : b; }
double min(double a, double b) { return a < b ? a : b; }
long long modd(long long a) {
  if (a < 0LL) return a * -1LL;
  return a;
}
double modd(double a) {
  if (a < 0.0) return a * -1.0;
  return a;
}
long long modulo(long long a) { return a % 1000000007LL; }
long long power(long long k, long long p) {
  if (p == 0) return 1LL;
  long long P = power(k, p / 2LL);
  P = (P * P) % 1000000007LL;
  if (p % 2 == 1) P = (P * k) % 1000000007LL;
  return P;
}
long long q = 0;
long long cc = 0;
void _merge(char arr[], long long low, long long mid, long long high) {
  long long n = high - low + 1;
  char res[n];
  long long left = low;
  long long right = mid + 1;
  char ans;
  long long itr = 0;
  while (left <= mid && right <= high) {
    if (cc == q) {
      exit(0);
    }
    cout << "? " << arr[left] << " " << arr[right] << endl;
    fflush(stdout);
    cc++;
    cin >> ans;
    if (ans == '<') {
      res[itr++] = arr[left++];
    } else {
      res[itr++] = arr[right++];
    }
  }
  while (left <= mid) {
    res[itr++] = arr[left++];
  }
  while (right <= high) {
    res[itr++] = arr[right++];
  }
  for (long long i = 0; i < n; i++) {
    arr[i + low] = res[i];
  }
}
void _sort(char arr[], long long low, long long high) {
  if (low >= high) {
    return;
  }
  long long mid = (low + high) / 2;
  _sort(arr, low, mid);
  _sort(arr, mid + 1, high);
  _merge(arr, low, mid, high);
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  long long n;
  cin >> n;
  long long a[n];
  for (long long i = 0; i < n; i++) {
    cin >> a[i];
  }
  long long b[n];
  for (long long i = 0; i < n; i++) {
    cin >> b[i];
  }
  vector<long long> c(n);
  for (long long i = 0; i < n; i++) {
    c[i] = a[i] - b[i];
  }
  sort(c.begin(), c.end());
  long long ans = 0;
  for (long long i = 0; i < n; i++) {
    if (c[i] <= 0) {
      continue;
    }
    long long elem = (c[i] * -1) + 1;
    long long elem_pos = lower_bound(c.begin(), c.end(), elem) - c.begin();
    ans += i - elem_pos;
  }
  cout << ans << endl;
  return 0;
}

```