#include <bits/stdc++.h>
using namespace std;
using ll = long long;
void print_vector(const vector<ll> &a) {
  for (auto &e : a) {
    cout << e << ' ';
  }
  cout << endl;
}
void print_vector(const vector<pair<ll, int>> &a) {
  for (auto &e : a) {
    cout << e.first << ' ';
  }
  cout << endl;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(nullptr);
  ll n;
  cin >> n;
  vector<pair<ll, int>> s(n);
  for (int i = 0; i < n; ++i) {
    cin >> s[i].first;
    s[i].second = i;
  }
  ll m;
  cin >> m;
  vector<pair<ll, int>> q(m);
  for (int i = 0; i < m; ++i) {
    ll l, r;
    cin >> l >> r;
    q[i].first = r - l;
    q[i].second = i;
  }
  if (n == 1) {
    for (auto &e : q) {
      cout << e.first + 1 << ' ';
    }
    cout << endl;
    return 0;
  }
  sort(begin(s), end(s));
  sort(begin(q), end(q));
  vector<ll> penalty(m);
  vector<ll> add(m);
  for (int i = 1; i < n; ++i) {
    auto it = lower_bound(begin(q), end(q),
                          make_pair(s[i].first - s[i - 1].first, 0));
    if (it != end(q)) {
      int index = it - begin(q);
      ++penalty[index];
      add[index] += s[i].first - s[i - 1].first;
    }
  }
  vector<ll> ans(m);
  ll total_penalty = 0;
  ll total_add = 0;
  for (int i = 0; i < m; ++i) {
    total_penalty += penalty[i];
    total_add += add[i];
    ans[q[i].second] = (n - total_penalty) * (q[i].first + 1) + total_add;
  }
  for (auto &e : ans) {
    cout << e << ' ';
  }
  cout << endl;
  return 0;
}
