#include <bits/stdc++.h>
using namespace std;
const long long INF = 5e18;
inline long long read() {
  long long w = 0, f = 1;
  char ch = getchar();
  while (ch < '0' || ch > '9') {
    if (ch == '-') f = -1;
    ch = getchar();
  }
  while (ch >= '0' && ch <= '9') {
    w = (w << 3) + (w << 1) + ch - 48;
    ch = getchar();
  }
  return w * f;
}
long long n, m, a[500010], b[500010], ans, cur, now[500010];
long long pre[500010];
bool debug;
map<long long, long long> mapp;
signed main() {
  n = read();
  for (long long i = 1; i <= n; i++) {
    now[i] = a[i] = read();
  }
  sort(a + 1, a + n + 1);
  for (long long i = 1; i <= n; i++) {
    if (!mapp[a[i]]) {
      cur++;
      mapp[a[i]] = cur;
      b[cur] = a[i];
    }
  }
  for (long long i = 1; i < cur; i++) {
    now[i] = b[i + 1] - b[i] - 1;
  }
  now[cur] = INF;
  sort(now + 1, now + cur + 1);
  for (long long i = 1; i <= cur; i++) {
    pre[i] = pre[i - 1] + now[i];
  }
  m = read();
  while (m--) {
    long long x = read();
    long long y = read();
    x = y - x;
    long long l = 0;
    long long r = cur;
    long long lst;
    while (l <= r) {
      long long mid = (l + r) >> 1;
      if (now[mid] <= x) {
        lst = mid;
        l = mid + 1;
      } else
        r = mid - 1;
    }
    long long ans = cur + pre[lst] + (cur - lst) * x;
    cout << ans << endl;
  }
  return 0;
}
