#include <bits/stdc++.h>
using namespace std;
vector<long long> par(100000 + 1, 0);
vector<long long> mi1(100000 + 1, 1000000000000000005LL);
vector<long long> ma1(100000 + 1, -1);
void init(vector<long long> &b) {
  for (long long i = 0; i < b.size(); i++) {
    par[i] = i;
    mi1[i] = b[i];
    ma1[i] = b[i];
  }
}
void uni(long long u, long long v, long long &val, long long h) {
  while (par[u] != u) {
    u = par[u];
  }
  while (par[v] != v) {
    v = par[v];
  }
  if (u != v) {
    val -= (ma1[v] + h - mi1[v] + ma1[u] + h - mi1[u]);
    par[v] = u;
    mi1[u] = min(mi1[u], mi1[v]);
    ma1[u] = max(ma1[u], ma1[v]);
    val += (ma1[u] + h - mi1[u]);
  }
}
int main() {
  long long n;
  cin >> n;
  vector<long long> a;
  for (long long i = 0; i < n; i++) {
    long long k;
    cin >> k;
    a.push_back(k);
  }
  sort(a.begin(), a.end());
  vector<long long> b;
  long long i = 1;
  while (i < n) {
    if (a[i] != a[i - 1]) {
      b.push_back(a[i - 1]);
    }
    i++;
  }
  b.push_back(a[i - 1]);
  init(b);
  set<pair<long long, pair<long long, long long> > > str;
  sort(b.begin(), b.end());
  for (long long i = 1; i < b.size(); i++) {
    str.insert(make_pair(b[i] - b[i - 1], make_pair(i, i - 1)));
  }
  set<pair<long long, long long> > s;
  vector<pair<long long, pair<long long, long long> > > v;
  long long q;
  cin >> q;
  long long z = 0;
  vector<long long> c(q, 0);
  while (q--) {
    long long l, r;
    cin >> l >> r;
    v.push_back(make_pair(l, make_pair(r, z)));
    s.insert(make_pair(r - l + 1, z));
    z++;
  }
  long long ans = b.size();
  long long h = ans;
  long long last = 1;
  while (!s.empty()) {
    pair<long long, long long> k1 = *s.begin();
    long long val = ans + (k1.first - last) * h;
    last = k1.first;
    s.erase(s.begin());
    while (!str.empty()) {
      pair<long long, pair<long long, long long> > k3 = *str.begin();
      if (k3.first < k1.first) {
        str.erase(str.begin());
        uni(k3.second.first, k3.second.second, val, k1.first);
        h--;
      } else
        break;
    }
    c[k1.second] = val;
    ans = val;
  }
  for (long long i = 0; i < c.size(); i++) cout << c[i] << " ";
  cout << endl;
  return 0;
}
