Problem: 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); 

Solution (in JAVA):

Solution:
import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.InputMismatchException;
import java.io.IOException;
import java.io.InputStream;

/**
 * Built using CHelper plug-in
 * Actual solution is at the top
 */
public class Main {
    public static void main(String[] args) {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        MyScan in = new MyScan(inputStream);
        PrintWriter out = new PrintWriter(outputStream);
        TaskE solver = new TaskE();
        solver.solve(1, in, out);
        out.close();
    }

    static class TaskE {
        public void solve(int testNumber, MyScan in, PrintWriter out) {
            long fy = -in.nextLong();
            long a = in.nextLong();
            long b = in.nextLong();
            int fence = in.nextInt();
            long[][] fences = new long[fence][];
            for (int s = 0; s < fence; s++) {
                fences[s] = in.nl(2);
            }

            long[] shaded = new long[fence + 1];

            for (int s = 0; s < fence; s++) {
                shaded[s + 1] = shaded[s] + fences[s][1] - fences[s][0];
            }

            int points = in.nextInt();

            while (points-- > 0) {
                int x = in.nextInt();
                int y = in.nextInt();
                double axi = inter(a, fy, x, y);
                double bxi = inter(b, fy, x, y);

                int leftMost = rm(fences, axi) - 1;
                int rightMost = rm(fences, bxi) + 1;

                leftMost = Math.max(0, leftMost);
                rightMost = Math.min(fence - 1, rightMost);


                double ann = 0;
                if (rightMost - 10 <= leftMost) {
                    for (int s = leftMost; s <= rightMost; s++) {
                        ann += f(fences[s], x, y, fy, a, b);
                    }
                } else {
                    long sha = shaded[rightMost - 4 + 1] - shaded[leftMost + 4];
                    ann += sha * 1D * (fy + y) / y;


                    for (int s = leftMost; s <= leftMost + 3; s++) {
                        ann += f(fences[s], x, y, fy, a, b);
                    }
                    for (int s = rightMost - 3; s <= rightMost; s++) {
                        ann += f(fences[s], x, y, fy, a, b);
                    }

                }
                out.println(ann);
            }

        }

        private double f(long[] fence, int x, int y, long fy, long a, long b) {
            double f0 = x - 1D * (x - fence[0]) * (fy + y) / y;
            double f1 = x - 1D * (x - fence[1]) * (fy + y) / y;
            return Math.max(Math.min(f1, b) - Math.max(f0, a), 0);
        }

        private int rm(long[][] fences, double x) {
            int f1 = 0;
            int f2 = fences.length;
            while (f1 + 1 < f2) {
                int m = (f1 + f2) / 2;
                if (fences[m][0] <= x && x <= fences[m][1]) {
                    return m;
                } else {
                    if (fences[m][1] < x) {
                        f1 = m;
                    } else {
                        f2 = m;
                    }
                }
            }
            return f1;
        }

        private double inter(long a, long fy, long x, long y) {
            long t = x - a;
            return a + 1D * t * fy / (y + fy);
        }

    }

    static class MyScan {
        private final InputStream in;
        private byte[] inbuf = new byte[1024];
        public int lenbuf = 0;
        public int ptrbuf = 0;

        public MyScan(InputStream in) {
            this.in = in;
        }

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

        public long[] nl(int n) {
            long[] k = new long[n];
            for (int i = 0; i < n; i++) {
                k[i] = nextLong();
            }
            return k;
        }

        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();
            }
        }

        public long nextLong() {
            long num = 0;
            int 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();
            }
        }

    }
}