#include <bits/stdc++.h>
int main(void) {
  long long int n;
  scanf("%lld", &n);
  std::vector<long long int> start;
  for (int i = 0; i < n; i++) {
    long long int temp;
    scanf("%lld", &temp);
    start.push_back(temp);
  }
  std::vector<long long int> mergepoint(n, -1);
  std::map<long long int, long long int> starting_values;
  for (long long int i = 0; i < n; i++) starting_values[start[i]] = i;
  for (long long int i = 0; i < n; i++) {
    auto it = starting_values.lower_bound(start[i] + 1);
    if (it != starting_values.end()) {
      mergepoint[i] = it->first - (long long int)start[i];
    } else
      mergepoint[i] = 1LL << 62;
  }
  std::multiset<long long int> used;
  std::vector<long long int> s_mergepoints, cumul_mergepoints;
  for (int i = 0; i < n; i++) {
    if (used.find(start[i]) == used.end()) {
      s_mergepoints.push_back(mergepoint[i]);
      used.insert(start[i]);
    }
  }
  std::sort(s_mergepoints.begin(), s_mergepoints.end());
  cumul_mergepoints.push_back(s_mergepoints[0]);
  for (long long int i = 1; i < s_mergepoints.size(); i++)
    cumul_mergepoints.push_back(cumul_mergepoints.back() + s_mergepoints[i]);
  long long int q;
  scanf("%lld", &q);
  for (long long int qq = 0; qq < q; qq++) {
    long long int l, r;
    scanf("%lld %lld", &l, &r);
    r -= l;
    l = 0;
    long long int index =
        std::upper_bound(s_mergepoints.begin(), s_mergepoints.end(), r) -
        s_mergepoints.begin();
    long long int result =
        (long long int)((long long int)s_mergepoints.size() - index) *
            (long long int)(r + 1) +
        (index > 0 ? cumul_mergepoints[index - 1] : 0);
    printf("%lld ", result);
  }
  return 0;
}
