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 static java.lang.Math.*;
import static java.util.Arrays.*;

import java.util.*;

public class E {

	public Object solve() {
		Y = sc.nextLong(); A = sc.nextLong(); B = sc.nextLong();
		int N = sc.nextInt();
		R = new long [2][N];
		for (int j : rep(N))
			for (int i : rep(2))
				R[i][j] = sc.nextLong();

		S = new long [N+1];
		for (int i : rep(N))
			S[i+1] = S[i] + R[1][i] - R[0][i];

		for (@SuppressWarnings("unused") int q : rep(sc.nextInt())) {
			long x = sc.nextLong(), y = sc.nextLong();
			double t = calc(x, y);
			double res = t * (y - Y) / y;
			print(res);
		}

		return null;
	}

	long [][] R;
	long [] S;
	long Y, A, B;

	double calc(long x, long y) {
		double J = zero(A, Y, x, y), K = zero(B, Y, x, y);
		int j = find(R[0], J), k = find (R[0], K);

		if (k < 0)
			return 0;
		if(j == k)
			return min(K, R[1][k]) - min(J, R[1][j]);

		double res = S[k] - S[j+1];
		if (j >= 0)
			res += max(0, R[1][j] - J);
		res += min(R[1][k], K) - R[0][k];
		return res;
	}

	int find(long [] R, double J) {
		int res = binarySearch(R, floor(J));
		if (res < 0)
			res = -res-2;
		return res;
	}

	double zero(long x1, double y1, long x2, double y2) {
		if (x1 == x2)
			return x2;

		double a = (y2 - y1) / (x2 - x1);
		double b = y1 - a * x1;
		double res = -b/a;
		return res;
	}

	private static final boolean ONE_TEST_CASE = true;

	private static void init() {
	}

	///////////////////////////////////////////////////////////////////////////
	private static final double eps = 9e-10;
	//	private static long fi (int N) {
	//		long res = N;
	//		for (long p : distinctPrimeDivisors(N))
	//			res = res * (p-1) / p;
	//		return res;
	//	}
	private static long floor (double x) { return round(Math.floor(x + eps)); }
	private static Iterable<Integer> rep (int N) { return rep(0, N); }
	private static Iterable<Integer> rep (final int S, final int T) { return new Iterable<Integer>() { public Iterator<Integer> iterator() { return S < T ? java.util.stream.IntStream.range(S,  T).iterator() : Collections.emptyIterator(); } }; }
	////////////////////////////////////////////////////////////////////////////////////
	private static IOUtils.MyScanner sc = new IOUtils.MyScanner();
	private static Object print (Object o, Object ... A) { IOUtils.print(o, A); return null; }
	private static class IOUtils {
		public static class MyScanner {
			public String next() { newLine(); return line[index++]; }
			public int nextInt() { return Integer.parseInt(next()); }
			public long nextLong() { return Long.parseLong(next()); }
			//////////////////////////////////////////////
			private boolean eol() { return index == line.length; }
			private String readLine() {
				try {
					return r.readLine();
				} catch (Exception e) {
					throw new Error (e);
				}
			}
			private final java.io.BufferedReader r;
			private MyScanner () { this(new java.io.BufferedReader(new java.io.InputStreamReader(System.in))); }
			private MyScanner (java.io.BufferedReader r) {
				try {
					this.r = r;
					while (!r.ready())
						Thread.sleep(1);
					start();
				} catch (Exception e) {
					throw new Error(e);
				}
			}
			private String [] line;
			private int index;
			private void newLine() {
				if (line == null || eol()) {
					line = split(readLine());
					index = 0;
				}
			}
			private String [] split(String s) { return s.length() > 0 ? s.split(" ") : new String [0]; }
		}
		private static String build(Object o, Object ... A) { return buildDelim(" ", o, A); }
		private static String buildDelim(String delim, Object o, Object ... A) {
			StringBuilder b = new StringBuilder();
			append(b, o, delim);
			for (Object p : A)
				append(b, p, delim);
			return b.substring(delim.length());
		}
		//////////////////////////////////////////////////////////////////////////////////
		private static void start() { if (t == 0) t = millis(); }
		private static void append(java.util.function.Consumer<Object> f, java.util.function.Consumer<Object> g, final Object o) {
			if (o.getClass().isArray()) {
				int len = java.lang.reflect.Array.getLength(o);
				for (int i = 0; i < len; ++i)
					f.accept(java.lang.reflect.Array.get(o, i));
			}
			else if (o instanceof Iterable<?>)
				((Iterable<?>)o).forEach(f::accept);
			else
				g.accept(o instanceof Double ? new java.text.DecimalFormat("#.#########").format(o) : o);
		}
		private static void append(final StringBuilder b, Object o, final String delim) {
			append(x -> { append(b, x, delim); }, x -> b.append(delim).append(x), o);
		}
		private static java.io.PrintWriter pw = new java.io.PrintWriter(System.out);
		private static Object print(Object o, Object ... A) { pw.println(build(o, A)); return null; }
		private static void err(Object o, Object ... A) { System.err.println(build(o, A)); }
		private static boolean PRINT;
		private static void write(Object o) {
			err(o, '(', time(), ')');
			if (PRINT)
				pw.println(o);
		}
		private static void exit() {
			IOUtils.pw.close();
			System.out.flush();
			err("------------------");
			err(time());
			System.exit(0);
		}
		private static long t;
		private static long millis() { return System.currentTimeMillis(); }
		private static String time() { return "Time: " + (millis() - t) / 1000.0; }
		private static void run(int N) {
			try { PRINT = System.getProperties().containsKey("PRINT"); }
			catch (Throwable t) {}

			for (int n = 1; n <= N; ++n) {
				Object res = new E().solve();
				if (res != null)
					write("Case #" + n + ": " + build(res));
			}
			exit();
		}
	}
	public static void main(String[] args) {
		init();
		int N = ONE_TEST_CASE ? 1 : sc.nextInt();
		IOUtils.run(N);
	}
}