#include <bits/stdc++.h>
using namespace std;
int main() {
  int a, b, sy;
  scanf("%d%d%d", &(sy), &(a), &(b));
  sy *= -1;
  set<pair<double, pair<int, int>>> m;
  int n, q;
  scanf("%d", &(n));
  int mr;
  for (int i = 0; i < (n); ++i) {
    int l, r;
    scanf("%d%d", &(l), &(r));
    m.insert({double(l), {1, 0}});
    m.insert({double(r), {-1, 0}});
    mr = r;
  }
  scanf("%d", &(q));
  for (int i = 0; i < (q); ++i) {
    int x, y;
    scanf("%d%d", &(x), &(y));
    double s, e;
    s = (double)a + (double(x - a) * sy) / (double(sy) + y);
    e = (double)b + (double(x - b) * sy) / (double(sy) + y);
    m.insert({s, {0, i + 1}});
    m.insert({e, {0, -i - 1}});
  }
  int hidden = 0;
  vector<pair<double, double>> rr(q);
  vector<double> rrr(q);
  double previous = 0;
  double disthidden = 0;
  double distot = 0;
  for (auto i : m) {
    if (hidden) {
      disthidden += (i.first - previous);
    }
    previous = i.first;
    if (!i.second.first) {
      if (i.second.second > 0) {
        rr[i.second.second - 1] = {disthidden, i.first};
      } else {
        int ix = -(i.second.second + 1);
        rrr[ix] = (double)(b - a) * (disthidden - rr[ix].first) /
                  (i.first - rr[ix].second);
      }
    }
    hidden += i.second.first;
  }
  for (int i = 0; i < (q); ++i) {
    printf("%.8f\n", rrr[i]);
  }
}
