#include <bits/stdc++.h>
using namespace std;
const int N = 1e5 + 10;
long long a[N], an[N];
pair<long long, int> query[N];
int main() {
  int n;
  scanf("%d", &n);
  for (int i = 1; i <= n; i++) scanf("%lld", &a[i]);
  sort(a + 1, a + n + 1);
  int m = unique(a + 1, a + n + 1) - a - 1;
  for (int i = 1; i < m; i++) a[i] = a[i + 1] - a[i];
  sort(a + 1, a + m);
  int qu;
  scanf("%d", &qu);
  for (int i = 1; i <= qu; i++) {
    long long a, b;
    scanf("%lld %lld", &a, &b);
    query[i].first = b - a + 1;
    query[i].second = i;
  }
  sort(query + 1, query + qu + 1);
  int p = 1;
  a[0] = 0;
  a[m++] = 2e18;
  long long ans = m - 1, sum = 0;
  for (int i = 1; i < m; i++) {
    while (p <= qu && query[p].first <= a[i]) {
      an[query[p].second] = sum + ans * (query[p].first - a[i - 1]);
      p++;
    }
    sum += (a[i] - a[i - 1]) * ans;
    ans--;
  }
  for (int i = 1; i <= qu; i++) printf("%lld ", an[i]);
  printf("\n");
  return 0;
}
