#include <bits/stdc++.h>
using namespace std;
int n, i, q;
long long s[100005], b[100005], l, r, sum[100005], ans;
struct node {
  int id;
  long long v;
  bool operator<(const node& _) const {
    if (_.v == v) return _.id > id;
    return _.v > v;
  }
} t[100005];
int find(long long x) {
  int l = 1, r = n - 1, mid, ans = 0;
  while (l <= r) {
    mid = l + r >> 1;
    if (b[mid] < x)
      ans = mid, l = mid + 1;
    else
      r = mid - 1;
  }
  return ans;
}
int main() {
  scanf("%d", &n);
  for (i = 1; i <= n; i++) cin >> s[i], t[i] = <% i, s[i] %>;
  sort(t + 1, t + n + 1), scanf("%d", &q);
  for (i = 1; i < n; i++) b[i] = t[i + 1].v - t[i].v;
  sort(b + 1, b + n);
  for (i = 1; i < n; i++) sum[i] = b[i] + sum[i - 1];
  while (q--) {
    cin >> l >> r, l = r - l + 1, r = find(l), ans = l * (n - r) + sum[r],
                   printf("%I64d", ans);
    if (q)
      printf(" ");
    else
      printf("\n");
  }
  return 0;
}
