#include <bits/stdc++.h>
using namespace std;
const long long N = 998244353;
const double MAX = 1000000010;
double sy, a, b;
vector<double> starts;
vector<double> en;
vector<double> sums;
double res(double x, double y) {
  double res = 0;
  int n = starts.size();
  double l = a + (x - a) * (sy / (y + sy));
  double r = b + (x - b) * (sy / (y + sy));
  auto k = lower_bound(en.begin(), en.end(), l) - en.begin();
  if (starts[k] <= l) {
    res -= (l - starts[k]);
  }
  auto t = lower_bound(starts.begin(), starts.end(), r) - starts.begin();
  if (en[t - 1] > r) {
    res -= (en[t - 1] - r);
  }
  res += sums[t - 1] - sums[k - 1];
  res = res * (y + sy) / y;
  return res;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin >> sy >> a >> b;
  sy = -sy;
  int n;
  cin >> n;
  int temp1, temp2;
  starts.push_back(-MAX);
  en.push_back(1 - MAX);
  for (int i = 0; i < n; i++) {
    cin >> temp1 >> temp2;
    starts.push_back(temp1);
    en.push_back(temp2);
  }
  starts.push_back(MAX);
  en.push_back(1 + MAX);
  sums.push_back(1);
  for (int i = 1; i < starts.size(); i++)
    sums.push_back(sums[i - 1] + en[i] - starts[i]);
  int q;
  cin >> q;
  for (int i = 0; i < q; i++) {
    cin >> temp1 >> temp2;
    cout << setprecision(10) << res(temp1, temp2) << '\n';
  }
}
