#include <bits/stdc++.h>
using namespace std;
long long b[100005], a[100005];
int find(long long vec[], long long key, long long low, long long high) {
  long long cur_max = -1;
  while (low <= high) {
    int mid = (low + high) / 2;
    if (vec[mid] < key) {
      low = mid + 1;
    } else if (vec[mid] > key) {
      cur_max = mid;
      high = mid - 1;
    } else {
      return mid;
    }
  }
  return cur_max;
}
int main() {
  long long n;
  cin >> n;
  for (long long i = 0; i < n; i++) {
    cin >> a[i];
  }
  sort(a, a + n);
  long long q;
  cin >> q;
  vector<long long> final_ans;
  b[0] = a[0];
  int cnt = 1;
  for (int i = 1; i < n; i++) {
    if (a[i] == a[i - 1]) {
      continue;
    } else {
      b[cnt] = a[i];
      cnt++;
    }
  }
  long long len = cnt;
  long long min_diff = b[1] - b[0];
  for (long long i = 2; i < cnt; i++) {
    if (b[i] - b[i - 1] < min_diff) min_diff = b[i] - b[i - 1];
  }
  while (q--) {
    long long l, r;
    cin >> l >> r;
    if (r - l < min_diff) {
      final_ans.push_back(len * (r - l + 1));
      continue;
    }
    long long ans = 0;
    long long index = 0;
    long long len = cnt;
    while (true) {
      long long low = b[index] + l;
      long long high = b[index] + r;
      ans += high - low + 1;
      if (index == len - 1) break;
      long long f = high + 1 - l;
      index = find(b, f, index + 1, len - 1);
      if (index == -1) {
        ans += (b[len - 1] + r - (f + l) + 1);
        break;
      }
      ans += (min(b[index - 1] + r, b[index] + l) - (f + l));
      if (b[index - 1] + r < b[index] + l) {
        ans++;
      }
    }
    final_ans.push_back(ans);
  }
  for (long long i = 0; i < final_ans.size(); i++) {
    cout << final_ans[i] << " ";
  }
  cout << endl;
}
