#include <bits/stdc++.h>
using namespace std;
inline long long rd() {
  char c = getchar();
  long long x = 0, flag = 1;
  for (; c < '0' || c > '9'; c = getchar())
    if (c == '-') flag = -1;
  for (; c >= '0' && c <= '9'; c = getchar()) x = x * 10 + c - '0';
  return x * flag;
}
struct node {
  long long x;
  int id;
  friend bool operator<(node a, node b) { return a.x < b.x; }
} p[100010] = {0};
int n, m, nxt[100010];
long long a[100010], ans[100010];
priority_queue<pair<long long, int>, vector<pair<long long, int> >,
               greater<pair<long long, int> > >
    q;
int main() {
  for (; !q.empty(); q.pop())
    ;
  n = rd();
  for (int i = 1; i <= n; i++) a[i] = rd();
  sort(a + 1, a + n + 1);
  int cnt = 0;
  for (int i = 2, j = 1; i <= n; i++)
    if (a[i] == a[j])
      a[i] = 1e18 + 1, cnt++;
    else
      j = i;
  sort(a + 1, a + n + 1);
  n -= cnt;
  m = rd();
  for (int i = 1; i <= m; i++) p[i] = (node){abs(rd() - rd()), i};
  sort(p + 1, p + m + 1);
  for (int i = 1; i < n; i++) nxt[i] = i + 1;
  for (int i = 1; i < n; i++) q.push(pair<long long, int>(a[i + 1] - a[i], i));
  long long res = 0;
  int num = n;
  for (int i = 1; i <= m; i++) {
    for (; !q.empty() && q.top().first <= p[i].x; num--) {
      pair<long long, int> pos = q.top();
      q.pop();
      int id = pos.second;
      res += a[nxt[id]] - a[id];
    }
    ans[p[i].id] = res + (p[i].x + 1) * num;
  }
  for (int i = 1; i <= m; i++) printf("%I64d ", ans[i]);
  puts("");
  return 0;
}
