#include <bits/stdc++.h>
using namespace std;
const int maxn = 2e5 + 7;
long long fence[2][maxn];
long long s, a, b, pre[maxn], first, second;
int n, q;
const long double eps = 1e12;
long double getox(long long v) {
  long double val = second * (first - v);
  val /= (second - s);
  val = first - val;
  return val;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  ;
  cin >> s >> a >> b >> n;
  for (int i = 1; i <= n; i++) {
    cin >> fence[0][i] >> fence[1][i];
    pre[i] = fence[1][i] - fence[0][i] + pre[i - 1];
  }
  cin >> q;
  while (q--) {
    cin >> first >> second;
    long double xl = getox(a), xr = getox(b), tot = 0;
    long long xintl = ceil(xl), xintr = floor(xr);
    int lptr = lower_bound(fence[0] + 1, fence[0] + n + 1, xintl) - fence[0];
    int rptr = upper_bound(fence[1] + 1, fence[1] + n + 1, xintr) - fence[1];
    rptr--;
    lptr--;
    if (lptr <= rptr) tot = pre[rptr] - pre[lptr];
    rptr++;
    if (lptr != rptr) {
      if (lptr >= 1 && lptr <= n && xl >= fence[0][lptr] &&
          xl <= fence[1][lptr])
        tot += (fence[1][lptr] - xl);
      if (rptr >= 1 && rptr <= n && xr >= fence[0][rptr] &&
          xr <= fence[1][rptr])
        tot += (xr - fence[0][rptr]);
    } else {
      tot = xr - xl;
    }
    tot *= (second + abs(s));
    tot /= second;
    cout.precision(12);
    cout << fixed << tot << '\n';
  }
  return 0;
}
