There is a light source on the plane. This source is so small that it can be represented as point. The light source is moving from point (a, s_y) to the (b, s_y) (s_y < 0) with speed equal to 1 unit per second. The trajectory of this light source is a straight segment connecting these two points. 

There is also a fence on OX axis represented as n segments (l_i, r_i) (so the actual coordinates of endpoints of each segment are (l_i, 0) and (r_i, 0)). The point (x, y) is in the shade if segment connecting (x,y) and the current position of the light source intersects or touches with any segment of the fence.

<image>

You are given q points. For each point calculate total time of this point being in the shade, while the light source is moving from (a, s_y) to the (b, s_y).

Input

First line contains three space separated integers s_y, a and b (-10^9 ≤ s_y < 0, 1 ≤ a < b ≤ 10^9) — corresponding coordinates of the light source.

Second line contains single integer n (1 ≤ n ≤ 2 ⋅ 10^5) — number of segments in the fence.

Next n lines contain two integers per line: l_i and r_i (1 ≤ l_i < r_i ≤ 10^9, r_{i - 1} < l_i) — segments in the fence in increasing order. Segments don't intersect or touch each other.

Next line contains single integer q (1 ≤ q ≤ 2 ⋅ 10^5) — number of points to check.

Next q lines contain two integers per line: x_i and y_i (1 ≤ x_i, y_i ≤ 10^9) — points to process.

Output

Print q lines. The i-th line should contain one real number — total time of the i-th point being in the shade, while the light source is moving from (a, s_y) to the (b, s_y). The answer is considered as correct if its absolute of relative error doesn't exceed 10^{-6}.

Example

Input

-3 1 6
2
2 4
6 7
5
3 1
1 3
6 1
6 4
7 6


Output

5.000000000000000
3.000000000000000
0.000000000000000
1.500000000000000
2.000000000000000

Note

  * The 1-st point is always in the shade; 
  * the 2-nd point is in the shade while light source is moving from (3, -3) to (6, -3); 
  * the 3-rd point is in the shade while light source is at point (6, -3). 
  * the 4-th point is in the shade while light source is moving from (1, -3) to (2.5, -3) and at point (6, -3); 
  * the 5-th point is in the shade while light source is moving from (1, -3) to (2.5, -3) and from (5.5, -3) to (6, -3); 
import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.io.OutputStream;
import java.io.Writer;
import java.io.IOException;
import java.io.InputStream;

/**
 * Built using CHelper plug-in
 * Actual solution is at the top
 * @author palayutm
*/public class Main {
	public static void main(String[] args) {
		InputStream inputStream = System.in;
		OutputStream outputStream = System.out;
		InputReader in = new InputReader(inputStream);
		OutputWriter out = new OutputWriter(outputStream);
		TaskE solver = new TaskE();
		solver.solve(1, in, out);
		out.close();
	}
static class TaskE   {
double cal(double x1, double y1, double x2, double y2) {
        return -y1 / (y2 - y1) * (x2 - x1) + x1;
    }

public void solve(int testNumber, InputReader in, OutputWriter out) {
        double S = in.nextDouble(), L = in.nextDouble(), R = in.nextDouble();
        int n = in.nextInt();
        double[][] a = new double[n][];
        for (int i = 0; i < n; i++) {
            int l = in.nextInt(), r = in.nextInt();
            a[i] = new double[]{l, r};
        }
        double[] b = new double[n + 1];
        for (int i = 1; i <= n; i++) {
            b[i] = b[i - 1] + a[i - 1][1] - a[i - 1][0];
        }
        int q = in.nextInt();
        while (q-- > 0) {
            double x = in.nextDouble(), y = in.nextDouble();
            double l = cal(L, S, x, y);
            double r = cal(R, S, x, y);
            int p1 = 0, p2 = 0;
            int low = 0, high = n - 1;
            while (low <= high) {
                int mid = (low + high) / 2;
                if (a[mid][0] < l) low = mid + 1;
                else high = mid - 1;
            }
            p1 = high;
            low = 0;
            high = n - 1;
            while (low <= high) {
                int mid = (low + high) / 2;
                if (a[mid][1] < r) low = mid + 1;
                else high = mid - 1;
            }
            p2 = low;
            double ans = b[p2] - b[p1 + 1];
            if (p1 >= 0 && a[p1][1] > l) {
                ans += a[p1][1] - l;
            }
            if (p2 < n && a[p2][0] < r) {
                ans += r - a[p2][0];
            }
            ans = ans * (y - S) / y;
            out.printf("%.15f\n", ans);
        }
    }

}
static class InputReader   {
private InputStream stream;
private byte[] inbuf = new byte[1024];
private int lenbuf = 0;
private int ptrbuf = 0;

public InputReader(InputStream stream) {
        this.stream = stream;
    }

private int readByte() {
        if (lenbuf == -1) throw new UnknownError();
        if (ptrbuf >= lenbuf) {
            ptrbuf = 0;
            try {
                lenbuf = stream.read(inbuf);
            } catch (IOException e) {
                throw new UnknownError();
            }
            if (lenbuf <= 0) return -1;
        }
        return inbuf[ptrbuf++];
    }

private boolean isSpaceChar(int c) {
        return !(c >= 33 && c <= 126);
    }

private int skip() {
        int b;
        while ((b = readByte()) != -1 && isSpaceChar(b)) ;
        return b;
    }

public double nextDouble() {
        return Double.parseDouble(next());
    }

public String next() {
        int b = skip();
        StringBuilder sb = new StringBuilder();
        while (!(isSpaceChar(b))) { // when nextLine, (isSpaceChar(b) && b != ' ')
            sb.appendCodePoint(b);
            b = readByte();
        }
        return sb.toString();
    }

public int nextInt() {
        int num = 0, b;
        boolean minus = false;
        while ((b = readByte()) != -1 && !((b >= '0' && b <= '9') || b == '-')) ;
        if (b == '-') {
            minus = true;
            b = readByte();
        }

        while (true) {
            if (b >= '0' && b <= '9') {
                num = num * 10 + (b - '0');
            } else {
                return minus ? -num : num;
            }
            b = readByte();
        }
    }

}
static class OutputWriter extends PrintWriter  {
public OutputWriter(OutputStream out) {
        super(out);
    }

public OutputWriter(Writer out) {
        super(out);
    }

public void close() {
        super.close();
    }

}
}

