#include <bits/stdc++.h>
using namespace std;
int main() {
  ios::sync_with_stdio(false);
  cin.tie(NULL);
  cout.precision(10);
  int n;
  cin >> n;
  long long a[n];
  for (int i = 0; i < n; i++) cin >> a[i];
  sort(a, a + n);
  reverse(a, a + n);
  long long b[n], c[n];
  b[0] = 0;
  for (int i = 0; i < n - 1; i++) b[i + 1] = a[i] - a[i + 1];
  sort(b, b + n);
  for (int i = 0; i < n; i++) c[i] = b[i];
  for (int i = 1; i < n; i++) c[i] += c[i - 1];
  int t;
  cin >> t;
  while (t--) {
    long long d, p;
    cin >> d >> p;
    long long dp = p + 1 - d;
    int s = 0, h = n - 1;
    while (h > s) {
      int y = (h + s) / 2;
      if (h - s == 1) y++;
      if (b[y] > dp)
        h = y - 1;
      else
        s = y;
    }
    cout << (dp + c[h] + (n - 1 - h) * dp) << " ";
  }
  return 0;
}
