#include <bits/stdc++.h>
using namespace std;
double s, a, b, l[200005], r[200005], sum[200005], q, x, y, p1, p2, tt;
int u, v, i, n;
const double eps = 1e-9;
int main() {
  scanf("%lf%lf%lf", &s, &a, &b);
  scanf("%d", &n);
  for (i = 1; i <= n; i++) scanf("%lf%lf", &l[i], &r[i]);
  sum[0] = 0;
  for (i = 1; i <= n; i++) sum[i] = sum[i - 1] + r[i] - l[i];
  scanf("%lf", &q);
  for (i = 1; i <= q; i++) {
    scanf("%lf%lf", &x, &y);
    p1 = (x * s - a * y) / (s - y);
    p2 = (x * s - b * y) / (s - y);
    u = lower_bound(l + 1, l + n + 1, p1) - l;
    v = upper_bound(r + 1, r + n + 1, p2) - r;
    v--;
    tt = sum[v] - sum[u - 1];
    if (u - 1 > 0 && r[u - 1] >= p1) tt += r[u - 1] - p1;
    if (v + 1 <= n && l[v + 1] <= p2) tt += p2 - l[v + 1];
    if (tt < eps)
      printf("0.000000000\n");
    else {
      printf("%.9f\n", (b - a) * tt / (p2 - p1));
    }
  }
  return 0;
}
