import java.util.*;
import java.io.*;

public class C {
	FastScanner in;
	PrintWriter out;

	class Event implements Comparable<Event> {
		int type;
		long val;

		public Event(int type, long val) {
			this.type = type;
			this.val = val;
		}

		@Override
		public int compareTo(Event o) {
			if (val != o.val) {
				return Long.compare(val, o.val);
			}
			return Integer.compare(o.type, type);
		}
	}

	public void solve() throws IOException {
		int n = in.nextInt();
		long l  = in.nextLong();
		long vLine = in.nextLong();
		long vAnton = in.nextLong();
		long[] prob = new long[n + 1];
		long[] a = new long[n];
		long time = l;
		Event[] events = new Event[2 * n];
		int cnt = 0;
		for (int i = 0; i < n; i++) {
			a[i] = in.nextLong() * (vLine + vAnton);
			Event open = new Event(0, a[i] - vAnton * time);
			if (open.val < 0)
				open.val += 2 * l * (vLine + vAnton);
			Event close = new Event(1, a[i]);
			if (open.val > close.val)
				cnt++;
			events[2 * i] = open;
			events[2 * i + 1] = close;
		}
		Arrays.sort(events);
		long prev = 0;
		for (Event e : events) {
			if (e.type == 0)
				cnt++;
			if (e.type == 1)
				cnt--;
			prev = e.val;
		}
		for (Event e : events) {
			long val = e.val - prev;
			if (val < 0) {
				val += 2 * l * (vLine + vAnton);
			}
			prob[cnt] += val;
			if (e.type == 0)
				cnt++;
			if (e.type == 1)
				cnt--;
			prev = e.val;
		}
		for (int i = 0; i <= n; i++) {
			out.println(prob[i] * 1.0 / (2 * l * (vLine + vAnton)));
		}

	}

	public void run() {
		try {
			in = new FastScanner();
			out = new PrintWriter(System.out);

			solve();

			out.close();
		} catch (IOException e) {
			e.printStackTrace();
		}
	}

	class FastScanner {
		BufferedReader br;
		StringTokenizer st;

		FastScanner() {
			br = new BufferedReader(new InputStreamReader(System.in));
		}

		String next() {
			while (st == null || !st.hasMoreTokens()) {
				try {
					st = new StringTokenizer(br.readLine());
				} catch (IOException e) {
					e.printStackTrace();
				}
			}
			return st.nextToken();
		}

		int nextInt() {
			return Integer.parseInt(next());
		}

		long nextLong() {
			return Long.parseLong(next());
		}

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

	public static void main(String[] arg) {
		new C().run();
	}
}


import java.io.*;
import java.util.*;
import java.math.*;

import static java.lang.System.out;
// import static java.lang.Math.*;

public class BaiC implements Runnable {

  final double eps = 1e-9;

  class Event implements Comparable<Event> {
    double time;
    boolean in;
    public Event(double time, boolean in) {
      this.time = time;
      this.in = in;
    }

    public int compareTo(Event e) {
      if (time < e.time) return -1;
      if (time > e.time) return 1;
      return 0;
    }
  }

  int n, L;
  double[] a;
  double d;

  public void run() {
    n = nextInt();
    L = nextInt();
    double v1 = nextDouble();
    double v2 = nextDouble();
    d = L * v2 / (v1 + v2);
    a = new double[2 * n];
    for (int i = 0; i < n; ++i) {
      a[i] = nextInt();
      a[i + n] = a[i] + 2 * L;
    }
    ArrayList<Event> list = new ArrayList<Event>();
    for (int i = 0; i < 2 * n; ++i) {
      list.add(new Event(a[i] - d, true));
      list.add(new Event(a[i], false));
    }
    Collections.sort(list);
    int count = 0;
    double last = -2 * L;
    double[] len = new double[n + 1];
    for (int i = 0; i < list.size(); ++i) {
      Event e = list.get(i);
      if (e.in) ++count;
      else --count;
      double end = 2 * L;
      if (i + 1 < list.size()) end = Math.min(end, list.get(i + 1).time);
      double start = Math.max(0, e.time);
      len[count] += Math.max(0, end - start);
    }
    for (int i = 0; i <= n; ++i) {
      double p = len[i] / 2 / L;
      out.printf("%.10f\n", p);
    }
  }

    int[] ar(int st, int en) { int[] res = new int[Math.max(en - st, 0)]; for (int i = st; i < en; ++i) res[i - st] = i; return res; }
    int[] ar(int n) { return ar(0, n); }
    void viet(Object...os) { System.err.println(Arrays.deepToString(os)); }
    BufferedReader keyboard = new BufferedReader(new InputStreamReader(System.in));
    StringTokenizer strtok = null;

    String nextStr() {
        try {
            while(strtok == null || !strtok.hasMoreTokens())
                strtok = new StringTokenizer(keyboard.readLine());
            return strtok.nextToken();
        }
        catch(Exception ex) {
            System.out.println(ex.getMessage());
            ex.printStackTrace();
            return null;
        }
    }

    int nextInt() {
        return Integer.parseInt(nextStr());
    }

    long nextLong() {
        return Long.parseLong(nextStr());
    }

    double nextDouble() {
        return Double.parseDouble(nextStr());
    }

    public static void main(String[] args) {
        new BaiC().run();
    }
}


import java.io.*;
import java.util.*;
import java.math.*;

import static java.lang.System.out;
// import static java.lang.Math.*;

public class BaiC implements Runnable {

  final double eps = 1e-9;

  class Event implements Comparable<Event> {
    double time;
    boolean in;
    boolean out;
    public Event(double time, boolean in, boolean out) {
      this.time = time;
      this.in = in;
      this.out = out;
    }

    public int compareTo(Event e) {
      if (time < e.time) return -1;
      if (time > e.time) return 1;
      return 0;
    }
  }

  int n, L;
  double[] a;
  double d;

  public void run() {
    n = nextInt();
    L = nextInt();
    double v1 = nextDouble();
    double v2 = nextDouble();
    d = L * v2 / (v1 + v2);
    a = new double[2 * n];
    for (int i = 0; i < n; ++i) {
      a[i] = nextInt();
      a[i + n] = a[i] + 2 * L;
    }
    ArrayList<Event> list = new ArrayList<Event>();
    for (int i = 0; i < 2 * n; ++i) {
      list.add(new Event(a[i] - d, true, false));
      list.add(new Event(a[i], false, true));
    }
    list.add(new Event(0, false, false));
    Collections.sort(list);
    int count = 0;
    double last = -2 * L;
    double[] len = new double[n + 1];
    for (int i = 0; i < list.size(); ++i) {
      Event e = list.get(i);
      if (e.in) ++count;
      if (e.out) --count;
      double end = 2 * L;
      if (i + 1 < list.size()) end = Math.min(end, list.get(i + 1).time);
      double start = Math.max(0, e.time);
      len[count] += Math.max(0, end - start);
    }
    for (int i = 0; i <= n; ++i) {
      double p = len[i] / 2 / L;
      out.printf("%.10f\n", p);
    }
  }

    int[] ar(int st, int en) { int[] res = new int[Math.max(en - st, 0)]; for (int i = st; i < en; ++i) res[i - st] = i; return res; }
    int[] ar(int n) { return ar(0, n); }
    void viet(Object...os) { System.err.println(Arrays.deepToString(os)); }
    BufferedReader keyboard = new BufferedReader(new InputStreamReader(System.in));
    StringTokenizer strtok = null;

    String nextStr() {
        try {
            while(strtok == null || !strtok.hasMoreTokens())
                strtok = new StringTokenizer(keyboard.readLine());
            return strtok.nextToken();
        }
        catch(Exception ex) {
            System.out.println(ex.getMessage());
            ex.printStackTrace();
            return null;
        }
    }

    int nextInt() {
        return Integer.parseInt(nextStr());
    }

    long nextLong() {
        return Long.parseLong(nextStr());
    }

    double nextDouble() {
        return Double.parseDouble(nextStr());
    }

    public static void main(String[] args) {
        new BaiC().run();
    }
}


import static java.util.Arrays.deepToString;

import java.io.*;
import java.math.*;
import java.util.*;

public class Main {

    static void solve() {
        class point implements Comparable{
            int type;
            double cor;
            public point(int type, double cor)
            {
                this.type = type;
                this.cor = cor;
            }
            public int compareTo(Object obj){
                point p = (point) obj;
                if (this.cor < p.cor) return -1;
                if (this.cor > p.cor) return 1;
                return 0;
            }
        }
        int n = nextInt(); long l = nextLong();
        long v1 = nextLong(); long v2 = nextLong();
        long a [] = new long [n];
        for (int i = 0; i < n; i++) a[i] = nextLong();
        double d = ((v2 + 0.0)/(v1 + v2)) * l;
        double [] ans = new double [n + 1];
        point [] p = new point [2 * n]; double now;
        for (int i = 0; i < n; i++){
            p[i] = new point(-1, a[i]);
            now = a[i] - d; if (now < 0) now += 2*l;
            p[n + i] = new point(1, now);
        }
        int cur = 0; now = 0;
        for (int i = 0; i < n; i++) if (a[i] < d) cur++;
        Arrays.sort(p);
        for (int i = 0; i < 2 * n; i++){
            ans[cur] += p[i].cor - now;
            cur += p[i].type;
            now = p[i].cor;
        }
        ans[cur] += 2*l - p[2 * n - 1].cor;
        for (int i = 0; i < n + 1; i++){
            writer.println(ans[i]/(2*l));
        }
    }

    public static void main(String[] args) throws Exception {
        reader = new BufferedReader(new InputStreamReader(System.in));
        writer = new PrintWriter(System.out);

        //setTime();
        solve();
        //printTime();
        //printMemory();

        writer.close();
    }

    static BufferedReader reader;
    static PrintWriter writer;
    static StringTokenizer tok = new StringTokenizer("");
    static long systemTime;

    static void debug(Object... o) {
        System.err.println(deepToString(o));
    }

    static void setTime() {
        systemTime = System.currentTimeMillis();
    }

    static void printTime() {
        System.err.println("Time consumed: " + (System.currentTimeMillis() - systemTime));
    }

    static void printMemory() {
        System.err.println("Memory consumed: " + (Runtime.getRuntime().totalMemory() - Runtime.getRuntime().freeMemory()) / 1000 + "kb");
    }

    static String next() {
        while (!tok.hasMoreTokens()) {
            String w = null;
            try {
                w = reader.readLine();
            } catch (Exception e) {
                e.printStackTrace();
            }
            if (w == null)
                return null;
            tok = new StringTokenizer(w);
        }
        return tok.nextToken();
    }

    static int nextInt() {
        return Integer.parseInt(next());
    }

    static long nextLong() {
        return Long.parseLong(next());
    }

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

    static BigInteger nextBigInteger() {
        return new BigInteger(next());
    }
}


import java.io.*;
import java.util.*;

public class Candy {
	public static void main(String[] args) {
		new Candy().run();
	}

	BufferedReader br;
	StringTokenizer st;
	PrintWriter out;
	boolean eof = false;
	Random rand = new Random(12345);

	private void run() {
		Locale.setDefault(Locale.US);
		try {
			br = new BufferedReader(new InputStreamReader(System.in));
			out = new PrintWriter(System.out);
			solve();
			out.close();
		} catch (Throwable e) {
			e.printStackTrace();
			System.exit(566);
		}
	}

	String nextToken() {
		while (st == null || !st.hasMoreTokens()) {
			try {
				st = new StringTokenizer(br.readLine());
			} catch (Exception e) {
				eof = true;
				return "0";
			}
		}
		return st.nextToken();
	}

	int nextInt() {
		return Integer.parseInt(nextToken());
	}

	long nextLong() {
		return Long.parseLong(nextToken());
	}

	double nextDouble() {
		return Double.parseDouble(nextToken());
	}

	double eps = 1e-8;

	private void solve() throws IOException {
		int n = nextInt();
		long l = nextInt();
		double v1 = nextDouble();
		double v2 = nextDouble();
		double d = l / (v1 + v2) * v2;
		long[] a = new long[2 * n + 10];
		for (int i = 0; i < n; i++) {
			a[i] = nextLong();
		}
		for (int i = n; i < a.length; i++) {
			a[i] = a[i - n] + 2 * l;
		}
		double[] len = new double[n + 1];
		double left = a[0];
		double right = left + d;
		int j = 0;
		int sum = 0;
		while (a[j] < right) {
			j++;
			sum++;
		}
		for (int i = 0; i < n; i++) {
			sum--;
			while (true) {
				double d1 = a[i + 1] - left;
				double d2 = a[j] - right;
				if (d1 < d2) {
					len[sum] += d1;
					left = a[i + 1];
					right = left + d;
					break;
				} else {
					len[sum] += d2;
					right = a[j];
					left = right - d;
					j++;
					sum++;
				}
			}
		}
		for (int i = 0; i < len.length; i++) {
			len[i] /= 2 * l;
		}
		for (int i = 0; i < len.length; i++) {
			out.println(len[i]);
		}
	}
}


import java.util.*;
import static java.lang.Math.*;
import java.io.*;

public class C {
	public static void p(Object...o) {System.out.println(Arrays.deepToString(o));}
	public static void main(String[] args) {
		Scanner in = new Scanner(System.in);
		int N = in.nextInt();
		int L = in.nextInt();
		int V1 = in.nextInt();
		int V2 = in.nextInt();
		double T = L / (double)(V1+V2);
		double C = T * V2;

		double[] ans = new double[N+1];
		double[] enter = new double[N*3];
		double[] exit = new double[N*3];
		int current = 0;
		double P = 2 * L / (double)(V2);
		for (int i = 0; i < N;i++) {
			int A = in.nextInt();
			enter[i] = (A-C)/(double)V2;
			exit[i] = A/(double)V2;
			if (A <= C)
				current++;

			enter[i+N] = enter[i] + P;
			exit[i+N] = exit[i] + P;
			enter[i+2*N] = enter[i+N] + P;
			exit[i+2*N] = exit[i+N] + P;
		}
		Arrays.sort(enter);
		Arrays.sort(exit);

		int eni = 0;
		while(enter[eni] <= 0)
			eni++;
		int exi = 0;

		double t = 0;
//		System.out.println(Arrays.toString(enter));
//		System.out.println(Arrays.toString(exit));
//		System.out.println(current);
//		System.out.println(P+" "+C+" "+T);
		while (t < P) {
			double newTime = P;
			newTime = min(newTime, enter[eni]);
			newTime = min(newTime, exit[exi]);
			double len = newTime - t;
//			System.out.println("\t"+t +" "+newTime+" "+current);
			ans[current] += len;
			while (enter[eni] <= newTime) {
				current++;
				eni++;
			}
			while (exit[exi] <= newTime) {
				current--;
				exi++;
			}
			t = newTime;
		}

		for (int i = 0; i < ans.length; i++){
			System.out.format("%.012f", ans[i] / P);
			if (i < ans.length - 1)
				System.out.print(" ");
		}
		System.out.println();
	}
}


import java.util.*;
import static java.lang.Math.*;
import java.io.*;

public class C {
	public static void p(Object...o) {System.out.println(Arrays.deepToString(o));}
	public static void main(String[] args) {
		Scanner in = new Scanner(System.in);
		int N = in.nextInt();
		int L = in.nextInt();
		int V1 = in.nextInt();
		int V2 = in.nextInt();
		double T = L / (double)(V1+V2);
		double C = T*V2;

		double[] ans = new double[N+1];
		int[] A = new int[N];
		for(int i = 0; i < N;i++)
			A[i] = in.nextInt();

		double[] enter = new double[N*3];
		double[] exit = new double[N*3];
		int current = 0;
		double P = 2 * L / (double)(V2);
		for (int i = 0; i < N;i++) {
			enter[i] = (A[i]-C)/(double)V1;
			exit[i] = (A[i])/(double)V1;
			if (enter[i] <= 0 && exit[i] >= 0)
				current++;

			enter[i+N] = enter[i] + P;
			exit[i+N] = exit[i] + P;
			enter[i+2*N] = enter[i+N] + P;
			exit[i+2*N] = exit[i+N] + P;
		}
		Arrays.sort(enter);
		Arrays.sort(exit);

		int eni = 0;
		while(enter[eni] <= 0)
			eni++;
		int exi = 0;

		double t = 0;
//		System.out.println(Arrays.toString(enter));
//		System.out.println(Arrays.toString(exit));
//		System.out.println(current);
//		System.out.println(P+" "+C+" "+T);
		while (t < P) {
			double newTime = P;
			newTime = min(newTime, enter[eni]);
			newTime = min(newTime, exit[exi]);
			double len = newTime - t;
//			System.out.println("\t"+t +" "+newTime+" "+current);
			ans[current] += len;
			while (enter[eni] <= newTime) {
				current++;
				eni++;
//				System.out.println("\t\tenter");
			}
			while (exit[exi] <= newTime) {
				current--;
				exi++;
//				System.out.println("\t\texit");
			}
			t = newTime;
		}

		for (int i = 0; i < ans.length; i++){
			System.out.format("%.012f", ans[i] / P);
			if (i < ans.length - 1)
				System.out.print(" ");
		}
		System.out.println();
	}
}


import java.io.*;
import java.util.*;

public class C implements Runnable {
    private MyScanner in;
    private PrintWriter out;

    private void solve() {
        int n = in.nextInt();
        int l = in.nextInt();
        int v1 = in.nextInt();
        int v2 = in.nextInt();
        int[] x = new int[n];
        for (int i = 0; i < n; ++i) {
            x[i] = in.nextInt();
        }
        double dist = 1. * v2 / (v1 + v2) * l;
        Event[] events = new Event[2 * n];
        for (int i = 0; i < n; ++i) {
            events[2 * i] = new Event(x[i], false);
            events[2 * i + 1] = new Event(x[i] - dist, true);
            if (events[2 * i + 1].coord < 0) {
                events[2 * i + 1].coord += 2 * l;
            }
        }
        Arrays.sort(events);
        int balance = 0;
        for (int i = 0; i < 2 * n; ++i) {
            if (events[i].coord >= dist) {
                break;
            }
            if (!events[i].start) {
                ++balance;
            }
        }
        double lo = 0;
        double[] ans = new double[n + 1];
        for (int i = 0; i < 2 * n; ++i) {
            double delta = events[i].coord - lo;
            if (delta < 0) {
                delta += 2 * l;
            }
            ans[balance] += delta;
            if (events[i].start) {
                ++balance;
            } else {
                --balance;
            }
            lo = events[i].coord;
        }
        ans[balance] += 2 * l - events[2 * n - 1].coord;
        for (int i = 0; i <= n; ++i) {
            out.printf(Locale.US, "%.20f%n", 0.5 * ans[i] / l);
        }
    }

    @Override
    public void run() {
        in = new MyScanner();
        out = new PrintWriter(System.out);
        solve();
        in.close();
        out.close();
    }

    public static void main(String[] args) {
        new C().run();
    }

    static class Event implements Comparable<Event> {
        public double coord;
        public boolean start;

        public Event(double time, boolean start) {
            this.coord = time;
            this.start = start;
        }

        @Override
        public int compareTo(Event o) {
            return Double.compare(coord, o.coord);
        }
    }

    static class MyScanner {
        private BufferedReader br;
        private StringTokenizer st;

        public MyScanner() {
            br = new BufferedReader(new InputStreamReader(System.in));
        }

        public void close() {
            try {
                br.close();
            } catch (IOException e) {
                e.printStackTrace();
            }
        }

        public String next() {
            while (st == null || !st.hasMoreTokens()) {
                try {
                    st = new StringTokenizer(br.readLine());
                } catch (IOException e) {
                    e.printStackTrace();
                    return null;
                }
            }
            return st.nextToken();
        }

        public String nextLine() {
            try {
                st = null;
                return br.readLine();
            } catch (IOException e) {
                e.printStackTrace();
                return null;
            }
        }

        public int nextInt() {
            return Integer.parseInt(next());
        }

        public long nextLong() {
            return Long.parseLong(next());
        }

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

        public boolean hasNext() {
            if (st != null && st.hasMoreTokens()) {
                return true;
            }
            try {
                while (br.ready()) {
                    st = new StringTokenizer(br.readLine());
                    if (st != null && st.hasMoreTokens()) {
                        return true;
                    }
                }
            } catch (IOException e) {
                e.printStackTrace();
            }
            return false;
        }
    }
}


import java.io.*;
import java.util.*;

public class C implements Runnable {
    private MyScanner in;
    private PrintWriter out;

    private void solve() {
        int n = in.nextInt();
        int l = in.nextInt();
        int v1 = in.nextInt();
        int v2 = in.nextInt();
        int[] x = new int[n];
        for (int i = 0; i < n; ++i) {
            x[i] = in.nextInt();
        }
        double dist = 1. * v2 / (v1 + v2) * l;
        Event[] events = new Event[2 * n];
        for (int i = 0; i < n; ++i) {
            events[2 * i] = new Event(x[i], false);
            events[2 * i + 1] = new Event(x[i] - dist, true);
            if (events[2 * i + 1].coord < 0) {
                events[2 * i + 1].coord += 2 * l;
            }
        }
        Arrays.sort(events);
        int balance = 0;
        final double EPS = 1e-8;
        for (int i = 0; i < 2 * n; ++i) {
            if (events[i].coord > dist - EPS) {
                break;
            }
            if (!events[i].start) {
                ++balance;
            }
        }
        double lo = 0;
        double[] ans = new double[n + 1];
        for (int i = 0; i < 2 * n; ++i) {
            double delta = events[i].coord - lo;
            if (delta < 0) {
                delta += 2 * l;
            }
            ans[balance] += delta;
            if (events[i].start) {
                ++balance;
            } else {
                --balance;
            }
            lo = events[i].coord;
        }
        ans[balance] += 2 * l - events[2 * n - 1].coord;
        for (int i = 0; i <= n; ++i) {
            out.printf(Locale.US, "%.20f%n", 0.5 * ans[i] / l);
        }
    }

    @Override
    public void run() {
        in = new MyScanner();
        out = new PrintWriter(System.out);
        solve();
        in.close();
        out.close();
    }

    public static void main(String[] args) {
        new C().run();
    }

    static class Event implements Comparable<Event> {
        public double coord;
        public boolean start;

        public Event(double time, boolean start) {
            this.coord = time;
            this.start = start;
        }

        @Override
        public int compareTo(Event o) {
            return Double.compare(coord, o.coord);
        }
    }

    static class MyScanner {
        private BufferedReader br;
        private StringTokenizer st;

        public MyScanner() {
            br = new BufferedReader(new InputStreamReader(System.in));
        }

        public void close() {
            try {
                br.close();
            } catch (IOException e) {
                e.printStackTrace();
            }
        }

        public String next() {
            while (st == null || !st.hasMoreTokens()) {
                try {
                    st = new StringTokenizer(br.readLine());
                } catch (IOException e) {
                    e.printStackTrace();
                    return null;
                }
            }
            return st.nextToken();
        }

        public String nextLine() {
            try {
                st = null;
                return br.readLine();
            } catch (IOException e) {
                e.printStackTrace();
                return null;
            }
        }

        public int nextInt() {
            return Integer.parseInt(next());
        }

        public long nextLong() {
            return Long.parseLong(next());
        }

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

        public boolean hasNext() {
            if (st != null && st.hasMoreTokens()) {
                return true;
            }
            try {
                while (br.ready()) {
                    st = new StringTokenizer(br.readLine());
                    if (st != null && st.hasMoreTokens()) {
                        return true;
                    }
                }
            } catch (IOException e) {
                e.printStackTrace();
            }
            return false;
        }
    }
}


import java.util.*;
import java.io.*;

public class c
{
    static double epsilon = 1.0e-3;
    public static void main(String[] axc) throws IOException
    {
        BufferedReader w = new BufferedReader(new InputStreamReader(System.in));
        StringTokenizer st = new StringTokenizer(w.readLine());
        int N = Integer.parseInt(st.nextToken());
        int L = Integer.parseInt(st.nextToken());
        int V1 = Integer.parseInt(st.nextToken());
        int V2 = Integer.parseInt(st.nextToken());

        double range = L / (double) (V1 + V2) * V2;
        Pair[] array = new Pair[4 * N];
        st = new StringTokenizer(w.readLine());
        for(int i = 0; i < N; i++)
        {
            long next = Integer.parseInt(st.nextToken());
            array[i] = new Pair(next - range, 1);
            array[N + i] = new Pair(next, -1);
            array[2 * N + i] = new Pair(2 * L + next - range, 1);
            array[3 * N + i] = new Pair(2 * L + next, -1);
        }
        Arrays.sort(array);

        double[] freq = new double[N + 1];
        int cur = 0;
        int i = 0;
        double last_x = 0.0;
        while(array[i].a < -epsilon)
        {
            i++;
            cur++;
        }
        while(last_x < 2 * L - epsilon)
        {
            double cur_x = array[i].a;
            freq[cur] += Math.min(2 * L, cur_x) - last_x;
            //System.out.println(last_x + " " + cur_x + ": " + cur);
            while(i < 4 * N && Math.abs(array[i].a - cur_x) < epsilon)
            {
                cur += array[i].b;
                i++;
            }
            last_x = Math.min(2 * L, cur_x);
        }

        for(i = 0; i <= N; i++)
            System.out.println(freq[i] / (2 * L));

        System.exit(0);
    }
    public static class Pair implements Comparable<Pair>
    {
        double a;
        int b;
        public Pair(double x, int y)
        {
            a = x;
            b = y;
        }
        public int compareTo(Pair other)
        {
            return (a - other.a > 0 ? 1 : -1);
        }
    }
}


import java.util.*;
import java.io.*;

public class c
{
    static double epsilon = 1.0e-3;
    public static void main(String[] axc) throws IOException
    {
        BufferedReader w = new BufferedReader(new InputStreamReader(System.in));
        StringTokenizer st = new StringTokenizer(w.readLine());
        int N = Integer.parseInt(st.nextToken());
        int L = Integer.parseInt(st.nextToken());
        int V1 = Integer.parseInt(st.nextToken());
        int V2 = Integer.parseInt(st.nextToken());

        double range = L / (double) (V1 + V2) * V2;
        Pair[] array = new Pair[4 * N];
        st = new StringTokenizer(w.readLine());
        for(int i = 0; i < N; i++)
        {
            int next = Integer.parseInt(st.nextToken());
            array[i] = new Pair(next - range, 1);
            array[N + i] = new Pair(next, -1);
            array[2 * N + i] = new Pair(2 * L + next - range, 1);
            array[3 * N + i] = new Pair(2 * L + next, -1);
        }
        Arrays.sort(array);

        double[] freq = new double[N + 1];
        int cur = 0;
        int i = 0;
        double last_x = 0.0;
        while(array[i].a < -epsilon)
        {
            i++;
            cur++;
        }
        while(last_x < 2 * L - epsilon)
        {
            double cur_x = array[i].a;
            freq[cur] += Math.min(2 * L, cur_x) - last_x;
            //System.out.println(last_x + " " + cur_x + ": " + cur);
            while(i < 4 * N && Math.abs(array[i].a - cur_x) < epsilon)
            {
                cur += array[i].b;
                i++;
            }
            last_x = Math.min(2 * L, cur_x);
        }

        for(i = 0; i <= N; i++)
            System.out.println(freq[i] / (2 * L));

        System.exit(0);
    }
    public static class Pair implements Comparable<Pair>
    {
        double a;
        int b;
        public Pair(double x, int y)
        {
            a = x;
            b = y;
        }
        public int compareTo(Pair other)
        {
            return (a - other.a > 0 ? 1 : -1);
        }
    }
}


import java.util.*;
import java.io.*;

public class Solution
{
    static double epsilon = 1.0e-6;
    public static void main(String[] axc) throws IOException
    {
        BufferedReader w = new BufferedReader(new InputStreamReader(System.in));
        StringTokenizer st = new StringTokenizer(w.readLine());
        int N = Integer.parseInt(st.nextToken());
        int L = Integer.parseInt(st.nextToken());
        int V1 = Integer.parseInt(st.nextToken());
        int V2 = Integer.parseInt(st.nextToken());

        double range = L / (double) (V1 + V2) * V2;
        Pair[] array = new Pair[4 * N];
        st = new StringTokenizer(w.readLine());
        for(int i = 0; i < N; i++)
        {
            int next = Integer.parseInt(st.nextToken());
            array[i] = new Pair(next - range, 1);
            array[N + i] = new Pair(next, -1);
            array[2 * N + i] = new Pair(2 * L + next - range, 1);
            array[3 * N + i] = new Pair(2 * L + next, -1);
        }
        Arrays.sort(array);

        double[] freq = new double[N + 1];
        int cur = 0;
        int i = 0;
        double last_x = 0.0;
        while(array[i].a < -epsilon)
        {
            i++;
            cur++;
        }
        while(last_x < 2 * L - epsilon)
        {
            double cur_x = array[i].a;
            freq[cur] += Math.min(2 * L, cur_x) - last_x;
            //System.out.println(last_x + " " + cur_x + ": " + cur);
            while(i < 4 * N && Math.abs(array[i].a - cur_x) < epsilon)
            {
                cur += array[i].b;
                i++;
            }
            last_x = Math.min(2 * L, cur_x);
        }

        for(i = 0; i <= N; i++)
            System.out.println(freq[i] / (2 * L));

        System.exit(0);
    }
    public static class Pair implements Comparable<Pair>
    {
        double a;
        int b;
        public Pair(double x, int y)
        {
            a = x;
            b = y;
        }
        public int compareTo(Pair other)
        {
            return (a - other.a > 0 ? 1 : -1);
        }
    }
}


import java.util.*;
import java.io.*;

public class c
{
    static double epsilon = 1.0e-6;
    public static void main(String[] axc) throws IOException
    {
        BufferedReader w = new BufferedReader(new InputStreamReader(System.in));
        StringTokenizer st = new StringTokenizer(w.readLine());
        int N = Integer.parseInt(st.nextToken());
        int L = Integer.parseInt(st.nextToken());
        int V1 = Integer.parseInt(st.nextToken());
        int V2 = Integer.parseInt(st.nextToken());

        double range = L / (double) (V1 + V2) * V2;
        Pair[] array = new Pair[4 * N];
        st = new StringTokenizer(w.readLine());
        for(int i = 0; i < N; i++)
        {
            int next = Integer.parseInt(st.nextToken());
            array[i] = new Pair(next - range, 1);
            array[N + i] = new Pair(next, -1);
            array[2 * N + i] = new Pair(2 * L + next - range, 1);
            array[3 * N + i] = new Pair(2 * L + next, -1);
        }
        Arrays.sort(array);

        double[] freq = new double[N + 1];
        int cur = 0;
        int i = 0;
        double last_x = 0.0;
        while(array[i].a < -epsilon)
        {
            i++;
            cur++;
        }
        while(i < 4 * N && last_x < 2 * L - epsilon)
        {
            double cur_x = array[i].a;
            freq[cur] += Math.min(2 * L, cur_x) - last_x;
            //System.out.println(last_x + " " + cur_x + ": " + cur);
            while(i < 4 * N && Math.abs(array[i].a - cur_x) < epsilon)
            {
                cur += array[i].b;
                i++;
            }
            last_x = Math.min(2 * L, cur_x);
        }

        for(i = 0; i <= N; i++)
            System.out.println(freq[i] / (2 * L));

        System.exit(0);
    }
    public static class Pair implements Comparable<Pair>
    {
        double a;
        int b;
        public Pair(double x, int y)
        {
            a = x;
            b = y;
        }
        public int compareTo(Pair other)
        {
            return (a - other.a > 0 ? 1 : -1);
        }
    }
}


import java.util.*;
import java.io.*;

public class c
{
    static double epsilon = 1.0e-3;
    public static void main(String[] axc) throws IOException
    {
        BufferedReader w = new BufferedReader(new InputStreamReader(System.in));
        StringTokenizer st = new StringTokenizer(w.readLine());
        int N = Integer.parseInt(st.nextToken());
        int L = Integer.parseInt(st.nextToken());
        int V1 = Integer.parseInt(st.nextToken());
        int V2 = Integer.parseInt(st.nextToken());

        double range = L / (double) (V1 + V2) * V2;
        Pair[] array = new Pair[4 * N];
        st = new StringTokenizer(w.readLine());
        for(int i = 0; i < N; i++)
        {
            int next = Integer.parseInt(st.nextToken());
            array[i] = new Pair(next - range, 1);
            array[N + i] = new Pair(next, -1);
            array[2 * N + i] = new Pair(2 * L + next - range, 1);
            array[3 * N + i] = new Pair(2 * L + next, -1);
        }
        Arrays.sort(array);

        double[] freq = new double[5*N + 1];
        int cur = 0;
        int i = 0;
        double last_x = 0.0;
        while(array[i].a < -epsilon)
        {
            i++;
            cur++;
        }
        while(last_x < 2 * L - epsilon)
        {
            double cur_x = array[i].a;
            freq[cur] += Math.min(2 * L, cur_x) - last_x;
            //System.out.println(last_x + " " + cur_x + ": " + cur);
            while(i < 4 * N && Math.abs(array[i].a - cur_x) < epsilon)
            {
                cur += array[i].b;
                i++;
            }
            last_x = Math.min(2 * L, cur_x);
        }

        for(i = 0; i <= N; i++)
            System.out.println(freq[i] / (2 * L));

        System.exit(0);
    }
    public static class Pair implements Comparable<Pair>
    {
        double a;
        int b;
        public Pair(double x, int y)
        {
            a = x;
            b = y;
        }
        public int compareTo(Pair other)
        {
            return (a - other.a > 0 ? 1 : -1);
        }
    }
}


import java.util.*;
import java.io.*;

public class c
{
    static double epsilon = 1.0e-6;
    public static void main(String[] axc) throws IOException
    {
        BufferedReader w = new BufferedReader(new InputStreamReader(System.in));
        StringTokenizer st = new StringTokenizer(w.readLine());
        int N = Integer.parseInt(st.nextToken());
        int L = Integer.parseInt(st.nextToken());
        int V1 = Integer.parseInt(st.nextToken());
        int V2 = Integer.parseInt(st.nextToken());

        double range = L / (double) (V1 + V2) * V2;
        Pair[] array = new Pair[4 * N];
        st = new StringTokenizer(w.readLine());
        for(int i = 0; i < N; i++)
        {
            int next = Integer.parseInt(st.nextToken());
            array[i] = new Pair(next - range, 1);
            array[N + i] = new Pair(next, -1);
            array[2 * N + i] = new Pair(2 * L + next - range, 1);
            array[3 * N + i] = new Pair(2 * L + next, -1);
        }
        Arrays.sort(array);

        double[] freq = new double[N + 1];
        int cur = 0;
        int i = 0;
        double last_x = 0.0;
        while(array[i].a < -epsilon)
        {
            i++;
            cur++;
        }
        while(i < 4 * N && last_x < 2 * L - epsilon)
        {
            double cur_x = array[i].a;
            freq[cur] += Math.min(2 * L, cur_x) - last_x;
            System.out.println(last_x + " " + cur_x + ": " + cur);
            while(i < 4 * N && Math.abs(array[i].a - cur_x) < epsilon)
            {
                cur += array[i].b;
                i++;
            }
            last_x = Math.min(2 * L, cur_x);
        }

        for(i = 0; i <= N; i++)
            System.out.println(freq[i] / (2 * L));

        System.exit(0);
    }
    public static class Pair implements Comparable<Pair>
    {
        double a;
        int b;
        public Pair(double x, int y)
        {
            a = x;
            b = y;
        }
        public int compareTo(Pair other)
        {
            return (a - other.a > 0 ? 1 : -1);
        }
    }
}


import java.io.IOException;
import java.util.Arrays;
import java.io.OutputStream;
import java.io.PrintWriter;
import java.util.NoSuchElementException;
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;
        MyScanner in = new MyScanner(inputStream);
        PrintWriter out = new PrintWriter(outputStream);
        TaskC solver = new TaskC();
        solver.solve(1, in, out);
        out.close();
    }
}

class TaskC {
    public void solve(int testNumber, MyScanner in, PrintWriter out) {
        int n = in.nextInt();
        long L = in.nextInt();
        double v1 = in.nextInt(), v2 = in.nextInt();
        double t = L / (v1 + v2);
        double len = t * v2;
        long[] _as = new long[n];
        for (int i = 0; i < n; i++) _as[i] = in.nextLong();
        {
            long min = Long.MAX_VALUE;
            for (long a : _as) min = Math.min(a, min);
            for (int i = 0; i < n; i++) _as[i] -= min;
        }
        Arrays.sort(_as);
        long[] as = new long[n * 2 + 1];
        for (int i = 0; i < n; i++) as[i] = _as[i];
        for (int i = 0; i < n; i++) as[i + n] = 2 * L + as[i];
        as[n * 2] = 4 * L;
        double[] res = new double[n + 1];
        int j=0;
        while(as[j]<len)j++;
        double from = 0;
        for (int i = 0; ; ) {
            double d1 = Math.min(2*L,as[i+1])-from;
            double d2 = Math.min(2*L,as[j] - len) - from;
            int cnt = j-i-1;
            if(d2>=d1){
                res[cnt] += d1;
                from += d1;
                i++;
            }else{
                res[cnt] += d2;
                from += d2;
                j++;
            }
            if(i==n || from >= 2*L-1e-9)break;
        }
        for (int i = 0; i < n + 1; i++)res[i] /= 2*L;
        for(double d:res){
            out.printf("%.18f\n",d);
        }
    }
}

class MyScanner {
    private final InputStream in;
    public MyScanner(InputStream in){
        this.in = in;
    }

    public int nextInt(){
        try{
            int c=in.read();
            if(c==-1) return c;
            while(c!='-'&&(c<'0'||'9'<c)){
                c=in.read();
                if(c==-1) return c;
            }
            if(c=='-') return -nextInt();
            int res=0;
            do{
                res*=10;
                res+=c-'0';
                c=in.read();
            }while('0'<=c&&c<='9');
            return res;
        }catch(Exception e){
            return -1;
        }
    }

    public long nextLong(){
        try{
            int c=in.read();
            if(c==-1) return c;
            while(c!='-'&&(c<'0'||'9'<c)){
                c=in.read();
                if(c==-1) return c;
            }
            if(c=='-') return -nextLong();
            long res=0;
            do{
                res*=10;
                res+=c-'0';
                c=in.read();
            }while('0'<=c&&c<='9');
            return res;
        }catch(Exception e){
            return -1;
        }
    }

    }


import static java.lang.Math.*;
import static java.util.Arrays.*;

import java.io.*;
import java.util.*;

public class C {
	Scanner sc = new Scanner(System.in);
	PrintWriter out = new PrintWriter(System.out);

	void run() {
		int n = sc.nextInt(), L = sc.nextInt(), v1 = sc.nextInt(), v2 = sc.nextInt();
		long[] a = new long[n * 2 + 1];
		for (int i = 0; i < n; i++) a[i] = sc.nextInt();
		for (int i = 0; i < n; i++) a[n + i] = 2 * L + a[i];
		a[2 * n] = L * 10L;
		double x = (double)v2 * L / (v1 + v2);
		double s = a[0];
		int t = 0;
		while (a[t] < s + x) t++;
		double[] res = new double[n + 1];
		for (int i = 0; i < n; ) {
			if (a[t] - (s + x) < a[i + 1] - s) {
				res[t - i - 1] += a[t] - (s + x);
				s += a[t] - (s + x);
				t++;
			} else {
				res[t - i - 1] += a[i + 1] - s;
				s = a[++i];
			}
		}
		for (int i = 0; i <= n; i++) {
			out.printf("%.12f%n", res[i] / (2 * L));
		}
		out.flush();
	}

	class Scanner {
		InputStream in;
		byte[] buf = new byte[1 << 10];
		int p, m;
		boolean[] isSpace = new boolean[128];
		Scanner(InputStream in) {
			this.in = in;
			isSpace[' '] = isSpace['\n'] = isSpace['\r'] = isSpace['\t'] = true;
		}
		int read() {
			if (m == -1) return -1;
			if (p >= m) {
				p = 0;
				try {
					m = in.read(buf);
				} catch (IOException e) {
					throw new RuntimeException(e);
				}
				if (m <= 0) return -1;
			}
			return buf[p++];
		}
		boolean hasNext() {
			int c = read();
			while (c >= 0 && isSpace[c]) c = read();
			if (c == -1) return false;
			p--;
			return true;
		}
		int nextInt() {
			if (!hasNext()) throw new InputMismatchException();
			int c = read();
			int sgn = 1;
			if (c == '-') {
				sgn = -1;
				c = read();
			}
			int res = 0;
			do {
				if (c < '0' || c > '9') throw new InputMismatchException();
				res *= 10;
				res += c - '0';
				c = read();
			} while (c >= 0 && !isSpace[c]);
			return res * sgn;
		}
	}

	void debug(Object...os) {
		System.err.println(deepToString(os));
	}

	public static void main(String[] args) {
		new C().run();
	}
}


import java.io.*;
import java.util.*;

public class Main {
//	static Scanner in; static int next() throws Exception {return in.nextInt();};
	static StreamTokenizer in; static int next() throws Exception {in.nextToken(); return (int) in.nval;}
//	static BufferedReader in;
	static PrintWriter out;

	public static void main(String[] args) throws Exception {
//		in = new Scanner(System.in);
		in = new StreamTokenizer(new BufferedReader(new InputStreamReader(System.in)));
//		in = new BufferedReader(new InputStreamReader(System.in));
		out = new PrintWriter(System.out);

		int n = next();
		long l = next();
		long v1 = next();
		long v2 = next();

		long[] a = new long[3 * n];
		for (int i = 0; i < n; i++) a[i] = next();
		for (int i = 0; i < 2*n; i++) a[i + n] = a[i] + 2L*l;

//		for (long x : a) out.print(x + " ");
//		out.println();

		double len = v2 * ((double)l / (v1 + v2));
//		out.println(len);

		double[] p = new double[n + 1];

		double start = 0;
		int kol = 0;
		int inds = -1;
		int inde = 0;
		for (int i = 0; i < n; i++) if (a[i] * (v1 + v2) < l * v2) {
			kol++;
			inds = i;
		}
		inds++;
//		out.println(inds + " " + inde);
		while (start < 2*l) {
//			System.out.println(start + " " + kol + " " + inds + " " + inde);
			if (a[inde] < 2*l || a[inds] * (v1 + v2) - v2 * l < 2*l * (v1 + v2)) {
				if (a[inde] * (v1 + v2) < a[inds] * (v1 + v2) - v2 * l) {
					p[kol--] += a[inde] - start;
					start = a[inde++];
				} else {
					p[kol++] += a[inds] - len - start;
					start = a[inds++] - len;
				}
			} else {
				p[kol] += 2*l - start;
				break;
			}
		}

		for (int i = 0; i <= n; i++) out.println(p[i]/2/l);

		out.close();
	}
}


import static java.lang.Double.parseDouble;
import static java.lang.Integer.parseInt;
import static java.lang.Long.parseLong;
import static java.lang.Math.min;
import static java.lang.System.exit;

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.OutputStreamWriter;
import java.io.PrintWriter;
import java.util.Locale;
import java.util.StringTokenizer;

public class C {

	static BufferedReader in;
	static PrintWriter out;
	static StringTokenizer tok;

	static void solve() throws Exception {
		int n = nextInt();
		long l = nextLong();
		long v1 = nextLong();
		long v2 = nextLong();
		long a[] = new long[2 * n + 1];
		for (int i = 0; i < n; i++) {
			a[i] = nextLong();
		}
		for (int i = 0; i < n; i++) {
			a[n + i] = a[i] + 2 * l;
		}
		a[2 * n] = 1L << 32;
		// length = l * v2 / (v1 + v2)
		long pos = 0; // 0 .. 2 * l * (v1 + v2)
		int p1 = 0;
		int p2 = 0;
		while (a[p2] * (v1 + v2) <= /*pos + */l * v2) {
			++p2;
		}
		long ans[] = new long[n + 1];
		while (true) {
			long toGo = min(a[p1] * (v1 + v2) - pos, a[p2] * (v1 + v2) - pos - l * v2);
			toGo = min(toGo, 2 * l * (v1 + v2) - pos);
			ans[p2 - p1] += toGo;
			pos += toGo;
			if (pos >= 2 * l * (v1 + v2)) {
				break;
			}
			while (a[p1] * (v1 + v2) <= pos) {
				++p1;
			}
			while (a[p2] * (v1 + v2) <= pos + l * v2) {
				++p2;
			}
		}
		for (int i = 0; i <= n; i++) {
			out.printf(Locale.US, "%.12f\n", (double) ans[i] / (2 * l * (v1 + v2)));
		}
	}

	static int nextInt() throws IOException {
		return parseInt(next());
	}

	static long nextLong() throws IOException {
		return parseLong(next());
	}

	static double nextDouble() throws IOException {
		return parseDouble(next());
	}

	static String next() throws IOException {
		while (tok == null || !tok.hasMoreTokens()) {
			tok = new StringTokenizer(in.readLine());
		}
		return tok.nextToken();
	}

	public static void main(String[] args) {
		try {
			in = new BufferedReader(new InputStreamReader(System.in));
			out = new PrintWriter(new OutputStreamWriter(System.out));
			solve();
			in.close();
			out.close();
		} catch (Throwable e) {
			e.printStackTrace();
			exit(1);
		}
	}
}


import java.io.*;
import java.util.Arrays;
import java.util.Locale;
import java.util.StringTokenizer;

public class C {
	BufferedReader in;
	StringTokenizer str;
	PrintWriter out;
	String SK;

	String next() throws IOException {
		while ((str == null) || (!str.hasMoreTokens())) {
			SK = in.readLine();
			if (SK == null)
				return null;
			str = new StringTokenizer(SK);
		}
		return str.nextToken();
	}

	int nextInt() throws IOException {
		return Integer.parseInt(next());
	}

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

	long nextLong() throws IOException {
		return Long.parseLong(next());
	}

	class sob implements Comparable<sob> {
		int add;
		long cord;

		public sob(long x, int ad) {
			cord = Math.max(x, 0);
			add = ad;
		}

		@Override
		public int compareTo(sob o) {
			return (int) Math.signum(cord - o.cord);
		}
	}

	void solve() throws IOException {
		int n = nextInt();
		long l = nextLong();
		long v2 = nextLong();
		long v1 = nextLong();
		long mul = (v1 + v2);
		long down = l * v1;
		sob[] a = new sob[4 * n];
		int t = 0;
		for (int i = 0; i < n; i++) {
			long pos = nextLong() * mul;
			a[t++] = new sob(pos, -1);
			a[t++] = new sob((pos - down), 1);
			a[t++] = new sob(2 * l * mul + pos, -1);
			a[t++] = new sob((2 * l * mul + pos - down), 1);
		}
		Arrays.sort(a);
		long res[] = new long[n + 1];
		int bal = 0;
		long last = 0;
		for (int i = 0; i < 4 * n; i++) {
			if (a[i].cord > 2 * l * mul) {
				res[Math.max(bal, 0)] += 2 * l * mul - last;
				break;
			}
			res[Math.max(bal, 0)] += a[i].cord - last;
			bal += a[i].add;
			last = a[i].cord;
		}
		for (int i = 0; i <= n; i++) {
			out.printf(Locale.US, "%.12f\n", (double) res[i]
					/ (double) (2 * l * mul));
		}

	}

	void run() throws IOException {
		in = new BufferedReader(new InputStreamReader(System.in));
		out = new PrintWriter(System.out);
		solve();
		out.close();
	}

	public static void main(String[] args) throws IOException {
		new C().run();
	}

}


import java.io.*;
import java.util.*;

public class Solution {

	private StringTokenizer st;
	private BufferedReader in;
	private PrintWriter out;

	public void solve() throws IOException {
		int n = nextInt();
		double len = nextDouble();
		double v1 = nextDouble();
		double v2 = nextDouble();
		double l1 = v2 * len / (v1 + v2);
		double[] a = new double[2 * n];
		for (int i = 0; i < n; ++i) {
			a[i] = nextDouble();
			a[n + i] = a[i] + 2. * len;
		}
		double pos = 0.;
		int l = 0, r = 0;
		final double EPS = 1e-12;
		while (r < 2 * n && a[r] <= l1 + EPS) {
			++r;
		}
		while (l < 2 * n && a[l] < EPS) {
			++l;
		}
//		System.err.println(Arrays.toString(a) + " " + len + " " + l1);
		double[] ans = new double[n + 1];
		while (pos < 2 * len - EPS) {
			double next = 2 * len;
			if (l < 2 * n && a[l] > pos + EPS) {
				next = Math.min(next, a[l]);
			}
//			System.err.println(pos + " " + next + " " + l + " " + r);
			if (r < 2 * n && a[r] - l1 > pos + EPS) {
				next = Math.min(next, a[r] - l1);
			}
			if (r - l <= n) {
				ans[r - l] += next - pos;
			}
			pos = next;
			while (l < 2 * n && a[l] < pos + EPS) {
				l++;
			}
			while (r < 2 * n && a[r] <= pos + l1 + EPS) {
				r++;
			}
		}
		for (int i = 0; i <= n; ++i) {
			out.println(ans[i] / len / 2.);
		}
	}

	public void run() throws IOException {
		in = new BufferedReader(new InputStreamReader(System.in));
		out = new PrintWriter(System.out);
		eat("");

		solve();

		out.close();
	}

	void eat(String s) {
		st = new StringTokenizer(s);
	}

	String next() throws IOException {
		while (!st.hasMoreTokens()) {
			String line = in.readLine();
			if (line == null) {
				return null;
			}
			eat(line);
		}
		return st.nextToken();
	}

	int nextInt() throws IOException {
		return Integer.parseInt(next());
	}

	long nextLong() throws IOException {
		return Long.parseLong(next());
	}

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

	public static void main(String[] args) throws IOException {
		Locale.setDefault(Locale.US);
		new Solution().run();
	}

}


import java.io.*;
import java.util.*;

public class Solution {

	private StringTokenizer st;
	private BufferedReader in;
	private PrintWriter out;

	public void solve() throws IOException {
		int n = nextInt();
		double len = nextDouble();
		double v1 = nextDouble();
		double v2 = nextDouble();
		double l1 = v2 * len / (v1 + v2);
		double[] a = new double[2 * n];
		for (int i = 0; i < n; ++i) {
			a[i] = nextDouble();
			a[n + i] = a[i] + 2. * len;
		}
		double pos = 0.;
		int l = 0, r = 0;
		final double EPS = 1e-16;
		while (r < 2 * n && a[r] <= l1 + EPS) {
			++r;
		}
		while (l < 2 * n && a[l] < EPS) {
			++l;
		}
//		System.err.println(Arrays.toString(a) + " " + len + " " + l1);
		double[] ans = new double[n + 1];
		while (pos < 2 * len - EPS) {
			double next = 2 * len;
			if (l < 2 * n && a[l] > pos + EPS) {
				next = Math.min(next, a[l]);
			}
//			System.err.println(pos + " " + next + " " + l + " " + r);
			if (r < 2 * n && a[r] - l1 > pos + EPS) {
				next = Math.min(next, a[r] - l1);
			}
			if (r - l <= n) {
				ans[r - l] += next - pos;
			}
			pos = next;
			while (l < 2 * n && a[l] < pos + EPS) {
				l++;
			}
			while (r < 2 * n && a[r] <= pos + l1 + EPS) {
				r++;
			}
		}
		for (int i = 0; i <= n; ++i) {
			out.println(ans[i] / len / 2.);
		}
	}

	public void run() throws IOException {
		in = new BufferedReader(new InputStreamReader(System.in));
		out = new PrintWriter(System.out);
		eat("");

		solve();

		out.close();
	}

	void eat(String s) {
		st = new StringTokenizer(s);
	}

	String next() throws IOException {
		while (!st.hasMoreTokens()) {
			String line = in.readLine();
			if (line == null) {
				return null;
			}
			eat(line);
		}
		return st.nextToken();
	}

	int nextInt() throws IOException {
		return Integer.parseInt(next());
	}

	long nextLong() throws IOException {
		return Long.parseLong(next());
	}

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

	public static void main(String[] args) throws IOException {
		Locale.setDefault(Locale.US);
		new Solution().run();
	}

}


#include <iostream>
#include <vector>
#include <bits/stdc++.h>
#include <map>
#include <algorithm>
#include <iterator>
#include <map>
using namespace std;

#define ll long long

const ll mod = 998244353;

ll binomial[60][60];

int main(){
    ios::sync_with_stdio(false);
    cin.tie(0);
    map<ll,ll> mp;
    for(int i = 0;i<60;i++){
        for(int j=0;j<=i ;j++){
            if(j==i || j==0){
                binomial[i][j] = 1;
            }
            else{
                binomial[i][j] = binomial[i-1][j] + binomial[i-1][j-1];
            }
        }
    }
    ll d;
    cin >> d;
    ll tmp = d, i=2;
    vector<pair<ll,ll>> divisors_of_d;
    bool first =true;
    while(tmp % i == 0){
        if(first){
            divisors_of_d.push_back({i,1});
            first = false;
        }
        else{
            divisors_of_d[0].second++;
        }
        tmp /= i;
    }
    i++;
    while(tmp!=1){
        if(tmp%i == 0){
            if(divisors_of_d.size()!=0 && divisors_of_d[divisors_of_d.size()-1].first == i){
                divisors_of_d[divisors_of_d.size()-1].second++;
            }
            else{
                divisors_of_d.push_back({i,1});
            }
            tmp /= i;
        }
        else
        {
            i+=2;
        }

    }
    int q;
    cin >> q;
    ll u,v,g;
    ll p1, p2, sum, down, real_d = d;
    for(int j=0;j<q;j++){
        cin >> u >> v;
        g = __gcd(u,v);
        u /= g;
        v /= g;
        d /= g;
        sum = 0;
        tmp = 0;
        p1= 1, p2 =1;
        i =0;
        if(mp.find(u)!=mp.end()){
            p1 = mp.find(u)->second;
        }
        else
        {
        while(u!=1){
            tmp =0;
            while(u%divisors_of_d[i].first==0){
                u/=divisors_of_d[i].first;
                tmp++;
                sum++;
            }
            if(tmp != 0){
                p1 = (p1 * binomial[sum][tmp]) % mod;
            }
            i++;
        }
        mp.insert({u,p1});
        }
        sum = 0;
        tmp = 0;
        i =0;
        if(mp.find(v)!=mp.end()){
            p2 = mp.find(v)->second;
        }
        else
        {
        while(v!=1){
            tmp =0;
            while(v%divisors_of_d[i].first==0){
                v/=divisors_of_d[i].first;
                tmp++;
                sum++;
            }
            if(tmp != 0){
                p2 = (p2 * binomial[sum][tmp]) % mod;
            }
            i++;
        }
        mp.insert({v,p2});
        }
        cout << ((p1*p2)%mod) << "\n";
    }
    return 0;
}


#include <iostream>
#include <vector>
#include <bits/stdc++.h>
#include <map>
#include <algorithm>
#include <iterator>
#include <map>
using namespace std;

#define ll long long

const ll mod = 998244353;

ll binomial[60][60];

int main(){
    ios::sync_with_stdio(false);
    cin.tie(0);
    map<ll,ll> mp;
    for(int i = 0;i<60;i++){
        for(int j=0;j<=i ;j++){
            if(j==i || j==0){
                binomial[i][j] = 1;
            }
            else{
                binomial[i][j] = binomial[i-1][j] + binomial[i-1][j-1];
            }
        }
    }
    ll d;
    cin >> d;
    ll tmp = d, i=2;
    vector<pair<ll,ll>> divisors_of_d;
    bool first =true;
    while(tmp % i == 0){
        if(first){
            divisors_of_d.push_back({i,1});
            first = false;
        }
        else{
            divisors_of_d[0].second++;
        }
        tmp /= i;
    }
    i++;
    while(tmp!=1){
        if(tmp%i == 0){
            if(divisors_of_d.size()!=0 && divisors_of_d[divisors_of_d.size()-1].first == i){
                divisors_of_d[divisors_of_d.size()-1].second++;
            }
            else{
                divisors_of_d.push_back({i,1});
            }
            tmp /= i;
        }
        else
        {
            i+=2;
        }

    }
    int q;
    cin >> q;
    ll u,v,g, real_u, real_v;
    ll p1, p2, sum, down, real_d = d;
    for(int j=0;j<q;j++){
        cin >> u >> v;
        g = __gcd(u,v);
        u /= g;
        v /= g;
        d /= g;
        real_u = u;
        real_v = v;
        sum = 0;
        tmp = 0;
        p1= 1, p2 =1;
        i =0;
        if(mp.find(u)!=mp.end()){
            p1 = mp.find(u)->second;
        }
        else
        {
        while(u!=1){
            tmp =0;
            while(u%divisors_of_d[i].first==0){
                u/=divisors_of_d[i].first;
                tmp++;
                sum++;
            }
            if(tmp != 0){
                p1 = (p1 * binomial[sum][tmp]) % mod;
            }
            i++;
        }
        mp.insert({real_u,p1});
        }
        sum = 0;
        tmp = 0;
        i =0;
        if(mp.find(v)!=mp.end()){
            p2 = mp.find(v)->second;
        }
        else
        {
        while(v!=1){
            tmp =0;
            while(v%divisors_of_d[i].first==0){
                v/=divisors_of_d[i].first;
                tmp++;
                sum++;
            }
            if(tmp != 0){
                p2 = (p2 * binomial[sum][tmp]) % mod;
            }
            i++;
        }
        mp.insert({real_v,p2});
        }
        cout << ((p1*p2)%mod) << "\n";
    }
    return 0;
}


#include <iostream>
#include <vector>
#include <bits/stdc++.h>
#include <map>
#include <algorithm>
#include <iterator>
using namespace std;

#define ll long long

const ll mod = 998244353;

ll binomial[60][60];

int main(){
    ios::sync_with_stdio(false);
    cin.tie(0);
    for(int i = 0;i<60;i++){
        for(int j=0;j<=i ;j++){
            if(j==i || j==0){
                binomial[i][j] = 1;
            }
            else{
                binomial[i][j] = binomial[i-1][j] + binomial[i-1][j-1];
            }
        }
    }
    ll d;
    cin >> d;
    ll tmp = d, i=2;
    vector<pair<ll,ll>> divisors_of_d;
    while(tmp!=1){
        if(tmp%i == 0){
            if(divisors_of_d.size()!=0 && divisors_of_d[divisors_of_d.size()-1].first == i){
                divisors_of_d[divisors_of_d.size()-1].second++;
            }
            else{
                divisors_of_d.push_back({i,1});
            }
            tmp /= i;
        }
        else
        {
            i++;
        }

    }
    int q;
    cin >> q;
    ll u,v,g;
    ll p1, p2, sum, down;
    for(int j=0;j<q;j++){
        cin >> u >> v;
        g = __gcd(u,v);
        u /= g;
        v /= g;
        sum = 0;
        tmp = 0;
        p1= 1, p2 =1;
        for(int i=0;i<divisors_of_d.size();i++){
            tmp =0;
            while(u%divisors_of_d[i].first==0){
                u/=divisors_of_d[i].first;
                tmp++;
                sum++;
            }
            if(tmp != 0){
                p1 = (p1 * binomial[sum][tmp]) % mod;
            }
        }
        sum = 0;
        tmp = 0;
        for(int i=0;i<divisors_of_d.size();i++){
            tmp =0;
            while(v%divisors_of_d[i].first==0){
                v/=divisors_of_d[i].first;
                tmp++;
                sum++;
            }
            if(tmp != 0){
                p2 = (p2 * binomial[sum][tmp]) % mod;
            }
        }
        cout << ((p1*p2)%mod) << "\n";
    }
    return 0;
}


#include <iostream>
#include <vector>
#include <bits/stdc++.h>
#include <map>
#include <algorithm>
#include <iterator>
#include <map>
using namespace std;

#define ll long long

const ll mod = 998244353;

ll binomial[60][60];

int main(){
    ios::sync_with_stdio(false);
    cin.tie(0);
    map<ll,ll> mp;
    for(int i = 0;i<60;i++){
        for(int j=0;j<=i ;j++){
            if(j==i || j==0){
                binomial[i][j] = 1;
            }
            else{
                binomial[i][j] = binomial[i-1][j] + binomial[i-1][j-1];
            }
        }
    }
    ll d;
    cin >> d;
    ll tmp = d, i=2;
    vector<pair<ll,ll>> divisors_of_d;
    bool first =true;
    while(tmp % i == 0){
        if(first){
            divisors_of_d.push_back({i,1});
            first = false;
        }
        else{
            divisors_of_d[0].second++;
        }
        tmp /= i;
    }
    i++;
    while(tmp!=1 && i < sqrt(d)){
        if(tmp%i == 0){
            if(divisors_of_d.size()!=0 && divisors_of_d[divisors_of_d.size()-1].first == i){
                divisors_of_d[divisors_of_d.size()-1].second++;
            }
            else{
                divisors_of_d.push_back({i,1});
            }
            tmp /= i;
        }
        else
        {
            i+=2;
        }

    }
    if(tmp!=1){
        divisors_of_d.push_back({tmp,1});
    }
    int q;
    cin >> q;
    ll u,v,g, real_u, real_v;
    ll p1, p2, sum, down, real_d = d;
    for(int j=0;j<q;j++){
        cin >> u >> v;
        g = __gcd(u,v);
        u /= g;
        v /= g;
        d /= g;
        real_u = u;
        real_v = v;
        sum = 0;
        tmp = 0;
        p1= 1, p2 =1;
        i =0;
        if(mp.find(u)!=mp.end()){
            p1 = mp.find(u)->second;
        }
        else
        {
        while(u!=1){
            tmp =0;
            while(u%divisors_of_d[i].first==0){
                u/=divisors_of_d[i].first;
                tmp++;
                sum++;
            }
            if(tmp != 0){
                p1 = (p1 * binomial[sum][tmp]) % mod;
            }
            i++;
        }
        mp.insert({real_u,p1});
        }
        sum = 0;
        tmp = 0;
        i =0;
        if(mp.find(v)!=mp.end()){
            p2 = mp.find(v)->second;
        }
        else
        {
        while(v!=1){
            tmp =0;
            while(v%divisors_of_d[i].first==0){
                v/=divisors_of_d[i].first;
                tmp++;
                sum++;
            }
            if(tmp != 0){
                p2 = (p2 * binomial[sum][tmp]) % mod;
            }
            i++;
        }
        mp.insert({real_v,p2});
        }
        cout << ((p1*p2)%mod) << "\n";
    }
    return 0;
}


#include <iostream>
#include <vector>
#include <bits/stdc++.h>
#include <map>
#include <algorithm>
#include <iterator>
using namespace std;

#define ll long long

const ll mod = 998244353;

ll binomial[60][60];

int main(){
    ios::sync_with_stdio(false);
    cin.tie(0);
    for(int i = 0;i<60;i++){
        for(int j=0;j<=i ;j++){
            if(j==i || j==0){
                binomial[i][j] = 1;
            }
            else{
                binomial[i][j] = binomial[i-1][j] + binomial[i-1][j-1];
            }
        }
    }
    ll d;
    cin >> d;
    ll tmp = d, i=2;
    vector<ll> divisors_of_d;
    bool first = true;
    while(tmp % i == 0){
        if(first){
            divisors_of_d.push_back(2);
        }
        tmp /= 2;
    }
    first = true;
    i++;
    while(tmp!=1){
        if(tmp%i == 0){
            if(first){
                divisors_of_d.push_back(i);
            }
            tmp /= i;
        }
        else
        {
            i+=2;
            first = true;
        }

    }
    int q;
    cin >> q;
    ll u,v,g;
    ll p1, p2, sum, down;
    for(int j=0;j<q;j++){
        cin >> u >> v;
        g = __gcd(u,v);
        u /= g;
        v /= g;
        sum = 0;
        tmp = 0;
        p1= 1, p2 =1;
        i =0;
        while(u!=1){
            tmp =0;
            while(u%divisors_of_d[i]==0){
                u/=divisors_of_d[i];
                tmp++;
                sum++;
            }
            if(tmp != 0){
                p1 = (p1 * binomial[sum][tmp]) % mod;
            }
            i++;
        }
        sum = 0;
        tmp = 0;
        i =0;
        while(v!=1){
            tmp =0;
            while(v%divisors_of_d[i]==0){
                v/=divisors_of_d[i];
                tmp++;
                sum++;
            }
            if(tmp != 0){
                p2 = (p2 * binomial[sum][tmp]) % mod;
            }
            i++;
        }
        cout << ((p1*p2)%mod) << "\n";
    }
    return 0;
}


#include <iostream>
#include <vector>
#include <bits/stdc++.h>
#include <map>
#include <algorithm>
#include <iterator>
using namespace std;

#define ll long long

const ll mod = 998244353;

ll binomial[60][60];

int main(){
    ios::sync_with_stdio(false);
    cin.tie(0);
    for(int i = 0;i<60;i++){
        for(int j=0;j<=i ;j++){
            if(j==i || j==0){
                binomial[i][j] = 1;
            }
            else{
                binomial[i][j] = binomial[i-1][j] + binomial[i-1][j-1];
            }
        }
    }
    ll d;
    cin >> d;
    ll tmp = d, i=2;
    vector<pair<ll,ll>> divisors_of_d;
    while(tmp!=1){
        if(tmp%i == 0){
            if(divisors_of_d.size()!=0 && divisors_of_d[divisors_of_d.size()-1].first == i){
                divisors_of_d[divisors_of_d.size()-1].second++;
            }
            else{
                divisors_of_d.push_back({i,1});
            }
            tmp /= i;
        }
        else
        {
            i++;
        }

    }
    int q;
    cin >> q;
    ll u,v,g;
    ll p1, p2, sum, down;
    for(int j=0;j<q;j++){
        cin >> u >> v;
        g = __gcd(u,v);
        u /= g;
        v /= g;
        sum = 0;
        tmp = 0;
        p1= 1, p2 =1;
        i =0;
        while(u!=1){
            tmp =0;
            while(u%divisors_of_d[i].first==0){
                u/=divisors_of_d[i].first;
                tmp++;
                sum++;
            }
            if(tmp != 0){
                p1 = (p1 * binomial[sum][tmp]) % mod;
            }
            i++;
        }
        sum = 0;
        tmp = 0;
        i =0;
        while(v!=1){
            tmp =0;
            while(v%divisors_of_d[i].first==0){
                v/=divisors_of_d[i].first;
                tmp++;
                sum++;
            }
            if(tmp != 0){
                p2 = (p2 * binomial[sum][tmp]) % mod;
            }
            i++;
        }
        cout << ((p1*p2)%mod) << "\n";
    }
    return 0;
}


#pragma GCC optimize("O3", "unroll-loops")
#pragma GCC target("avx2")

#include <iostream>
#include <iomanip>
#include <vector>
#include <algorithm>
#include <cmath>
#include <string>
#include <map>
#include <unordered_map>
#include <set>
#include <unordered_set>
#include <bitset>
#include <sstream>
#include <deque>
#include <queue>
#include <complex>
#include <random>
#include <cassert>
#include <chrono>

using namespace std;

#define FAST ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0)
#define FIXED cout << fixed << setprecision(12)
#define ll long long
#define ld long double
#define pii pair<int, int>
#define pll pair<ll, ll>
#define graph vector<vector<int>>
#define pb push_back
#define pf push_front
#define popb pop_back
#define popf pop_front
#define f first
#define s second
#define hashmap unordered_map
#define hashset unordered_set
#define eps 1e-9
#define mod 998244353
#define inf 3000000000000000007ll
#define sz(a) signed(a.size())
#define all(a) a.begin(), a.end()
#define rall(a) a.rbegin(), a.rend()

#ifdef DEBUG
    mt19937 gen(857204);
#else
    mt19937 gen(chrono::high_resolution_clock::now().time_since_epoch().count());
#endif

template<class T, class U> inline void checkmin(T &x, U y) { if (y < x) x = y; }
template<class T, class U> inline void checkmax(T &x, U y) { if (y > x) x = y; }
template<class T, class U> inline bool ifmax(T &x, U y) { if (y > x) return x = y, true; return false; }
template<class T, class U> inline bool ifmin(T &x, U y) { if (y < x) return x = y, true; return false; }
template<class T> inline void sort(T &a) { sort(all(a)); }
template<class T> inline void rsort(T &a) { sort(rall(a)); }
template<class T> inline void reverse(T &a) { reverse(all(a)); }
template<class T, class U> inline istream& operator>>(istream& str, pair<T, U> &p) { return str >> p.f >> p.s; }
template<class T> inline istream& operator>>(istream& str, vector<T> &a) { for (auto &i : a) str >> i; return str; }
template<class T> inline T sorted(T a) { sort(a); return a; }

#include <ext/pb_ds/assoc_container.hpp>
using namespace __gnu_pbds;
struct chash {
    const int RANDOM = gen();
    static unsigned long long hash_f(unsigned long long x) {
        x += 0x9e3779b97f4a7c15;
        x = (x ^ (x >> 30)) * 0xbf58476d1ce4e5b9;
        x = (x ^ (x >> 27)) * 0x94d049bb133111eb;
        return x ^ (x >> 31);
    }
    static unsigned hash_combine(unsigned a, unsigned b) { return a * 31 + b; }
    int operator()(int x) const { return hash_f(x)^RANDOM; }
};
struct zet {
    int val;
    explicit operator int() const { return val; }
    zet(ll x = 0) { val = (x >= -mod && x < mod ? x : x % mod); if (val < 0) val += mod; }
    zet(ll a, ll b) { *this += a; *this /= b; }

    zet& operator+=(zet const &b) { val += b.val; if (val >= mod) val -= mod; return *this; }
    zet& operator-=(zet const &b) { val -= b.val; if (val < 0) val += mod; return *this; }
    zet& operator*=(zet const &b) { val = (val * (ll)b.val) % mod; return *this; }

    friend zet mypow(zet a, ll n) {
        zet res = 1;
        while (n) { if (n & 1) res *= a; a *= a; n >>= 1; }
        return res;
    }
    friend zet inv(zet a) { return mypow(a, mod - 2); }
    zet& operator/=(zet const& b) { return *this *= inv(b); }
    friend zet operator+(zet a, const zet &b) { return a += b; }
    friend zet operator-(zet a, const zet &b) { return a -= b; }
    friend zet operator-(zet a) { return 0 - a; }
    friend zet operator*(zet a, const zet &b) { return a *= b; }
    friend zet operator/(zet a, const zet &b) { return a /= b; }
    friend istream& operator>>(istream& stream, zet &a) { return stream >> a.val; }
    friend ostream& operator<<(ostream& stream, const zet &a) { return stream << a.val; }
    friend bool operator==(zet const &a, zet const &b) { return a.val == b.val; }
    friend bool operator!=(zet const &a, zet const &b) { return a.val != b.val; }
    friend bool operator<(zet const &a, zet const &b) { return a.val < b.val; }
};
vector<int> currdec;
gp_hash_table<ll, zet, chash> st;
vector<pll> dc;

const int N = 200;
zet C[N][N];

zet count(vector<int> dec) {
    int sum = 0;
    for (auto i : dec) sum += i;
    zet ans = 1;
    for (auto i : dec) {
        ans *= C[sum][i];
        sum -= i;
    }
    return ans;
}

void rec(int i, ll curr) {
    if (i == sz(dc)) {
        st[curr] = count(currdec);
        return;
    }
    currdec.pb(0);
    for (int j = 0; j <= dc[i].s; ++j) {
        rec(i + 1, curr);
        ++currdec.back();
        curr *= dc[i].f;
    }
    currdec.popb();
}

signed main() {
    FAST; FIXED;
    for (int i = 0; i < N; ++i) C[i][0] = 1;
    for (int i = 1; i < N; ++i)
        for (int j = 1; j < N; ++j)
            C[i][j] = C[i - 1][j] + C[i - 1][j - 1];
    ll D;
    cin >> D;
    for (ll i = 2; i * i <= D; ++i) {
        if (D % i == 0) {
            ll cnt = 0;
            while (D % i == 0) D /= i, ++cnt;
            dc.pb({i, cnt});
        }
    }
    if (D > 1) dc.pb({D, 1});
    rec(0, 1);
    int q;
    cin >> q;
    while (q--) {
        ll u, v;
        cin >> u >> v;
        ll g = __gcd(u, v);
        cout << st[u / g] * st[v / g] << '\n';
    }
    #ifdef DEBUG
        cerr << "Runtime is: " << clock() * 1.0 / CLOCKS_PER_SEC << endl;
    #endif
    return 0;
}


#pragma GCC optimize("O3", "unroll-loops")
#pragma GCC target("avx2")

#include <iostream>
#include <iomanip>
#include <vector>
#include <algorithm>
#include <cmath>
#include <string>
#include <map>
#include <unordered_map>
#include <set>
#include <unordered_set>
#include <bitset>
#include <sstream>
#include <deque>
#include <queue>
#include <complex>
#include <random>
#include <cassert>
#include <chrono>

using namespace std;

#define FAST ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0)
#define FIXED cout << fixed << setprecision(12)
#define ll long long
#define ld long double
#define pii pair<int, int>
#define pll pair<ll, ll>
#define graph vector<vector<int>>
#define pb push_back
#define pf push_front
#define popb pop_back
#define popf pop_front
#define f first
#define s second
#define hashmap unordered_map
#define hashset unordered_set
#define eps 1e-9
#define mod 998244353
#define inf 3000000000000000007ll
#define sz(a) signed(a.size())
#define all(a) a.begin(), a.end()
#define rall(a) a.rbegin(), a.rend()

#ifdef DEBUG
    mt19937 gen(857204);
#else
    mt19937 gen(chrono::high_resolution_clock::now().time_since_epoch().count());
#endif

template<class T, class U> inline void checkmin(T &x, U y) { if (y < x) x = y; }
template<class T, class U> inline void checkmax(T &x, U y) { if (y > x) x = y; }
template<class T, class U> inline bool ifmax(T &x, U y) { if (y > x) return x = y, true; return false; }
template<class T, class U> inline bool ifmin(T &x, U y) { if (y < x) return x = y, true; return false; }
template<class T> inline void sort(T &a) { sort(all(a)); }
template<class T> inline void rsort(T &a) { sort(rall(a)); }
template<class T> inline void reverse(T &a) { reverse(all(a)); }
template<class T, class U> inline istream& operator>>(istream& str, pair<T, U> &p) { return str >> p.f >> p.s; }
template<class T> inline istream& operator>>(istream& str, vector<T> &a) { for (auto &i : a) str >> i; return str; }
template<class T> inline T sorted(T a) { sort(a); return a; }

namespace io {
    using namespace std;
    static
    const int buf_size = 4096;
    static unsigned char buf[buf_size];
    static int buf_len = 0, buf_pos = 0;
    inline bool isEof() {
        if (buf_pos == buf_len) {
            buf_pos = 0, buf_len = fread(buf, 1, buf_size, stdin);
            if (buf_pos == buf_len) return 1;
        }
        return 0;
    }
    inline int getChar() {
        return isEof() ? -1 : buf[buf_pos++];
    }
    inline int peekChar() {
        return isEof() ? -1 : buf[buf_pos];
    }
    inline bool seekEof() {
        int c;
        while ((c = peekChar()) != -1 && c <= 32) buf_pos++;
        return c == -1;
    }
    inline void skipBlanks() {
        while (!isEof() && buf[buf_pos] <= 32U) buf_pos++;
    }
    inline int readChar() {
        int c = getChar();
        while (c != -1 && c <= 32) c = getChar();
        return c;
    }
    inline int readUInt() {
        int c = readChar(), x = 0;
        while ('0' <= c && c <= '9') x = x * 10 + c - '0', c = getChar();
        return x;
    }
    inline ll readULong() {
        int c = readChar();
        ll x = 0;
        while ('0' <= c && c <= '9') x = x * 10 + c - '0', c = getChar();
        return x;
    }
    template < class T = int > inline T readInt() {
        int s = 1, c = readChar();
        T x = 0;
        if (c == '-') s = -1, c = getChar();
        else if (c == '+') c = getChar();
        while ('0' <= c && c <= '9') x = x * 10 + c - '0', c = getChar();
        return s == 1 ? x : -x;
    }
    inline double readDouble() {
        int s = 1, c = readChar();
        double x = 0;
        if (c == '-') s = -1, c = getChar();
        while ('0' <= c && c <= '9') x = x * 10 + c - '0', c = getChar();
        if (c == '.') {
            c = getChar();
            double coef = 1;
            while ('0' <= c && c <= '9') x += (c - '0') * (coef *= 1e-1), c = getChar();
        }
        return s == 1 ? x : -x;
    }
    inline void readWord(char * s) {
        int c = readChar();
        while (c > 32) * s++ = c, c = getChar();* s = 0;
    }
    inline bool readLine(char * s) {
        int c = getChar();
        while (c != '\n' && c != -1) * s++ = c, c = getChar();* s = 0;
        return c != -1;
    }
    static int write_buf_pos = 0;
    static char write_buf[buf_size];
    inline void writeChar(int x) {
        if (write_buf_pos == buf_size) fwrite(write_buf, 1, buf_size, stdout), write_buf_pos = 0;
        write_buf[write_buf_pos++] = x;
    }
    inline void flush() {
        if (write_buf_pos) {
            fwrite(write_buf, 1, write_buf_pos, stdout), write_buf_pos = 0;
            fflush(stdout);
        }
    }
    template < class T > inline void writeInt(T x, char end = 0, int output_len = -1) {
        if (x < 0) writeChar('-'), x = -x;
        char s[24];
        int n = 0;
        while (x || !n) s[n++] = '0' + x % 10, x /= 10;
        while (n < output_len) s[n++] = '0';
        while (n--) writeChar(s[n]);
        if (end) writeChar(end);
    }
    inline void writeWord(const char * s) {
        while ( * s) writeChar( * s++);
    }
    inline void writeDouble(double x, int output_len = 0) {
        if (x < 0) writeChar('-'), x = -x;
        int t = (int) x;
        writeInt(t), x -= t;
        writeChar('.');
        for (int i = output_len - 1; i > 0; i--) {
            x *= 10;
            t = std::min(9, (int) x);
            writeChar('0' + t), x -= t;
        }
        x *= 10;
        t = std::min(9, (int)(x + 0.5));
        writeChar('0' + t);
    }
    static struct buffer_flusher_t {
        ~buffer_flusher_t() {
            flush();
        }
    }
    buffer_flusher;
};

using namespace io;

struct zet {
    int val;
    explicit operator int() const { return val; }
    zet(ll x = 0) { val = (x >= -mod && x < mod ? x : x % mod); if (val < 0) val += mod; }
    zet(ll a, ll b) { *this += a; *this /= b; }

    zet& operator+=(zet const &b) { val += b.val; if (val >= mod) val -= mod; return *this; }
    zet& operator-=(zet const &b) { val -= b.val; if (val < 0) val += mod; return *this; }
    zet& operator*=(zet const &b) { val = (val * (ll)b.val) % mod; return *this; }

    friend zet mypow(zet a, ll n) {
        zet res = 1;
        while (n) { if (n & 1) res *= a; a *= a; n >>= 1; }
        return res;
    }
    friend zet inv(zet a) { return mypow(a, mod - 2); }
    zet& operator/=(zet const& b) { return *this *= inv(b); }
    friend zet operator+(zet a, const zet &b) { return a += b; }
    friend zet operator-(zet a, const zet &b) { return a -= b; }
    friend zet operator-(zet a) { return 0 - a; }
    friend zet operator*(zet a, const zet &b) { return a *= b; }
    friend zet operator/(zet a, const zet &b) { return a /= b; }
    friend istream& operator>>(istream& stream, zet &a) { return stream >> a.val; }
    friend ostream& operator<<(ostream& stream, const zet &a) { return stream << a.val; }
    friend bool operator==(zet const &a, zet const &b) { return a.val == b.val; }
    friend bool operator!=(zet const &a, zet const &b) { return a.val != b.val; }
    friend bool operator<(zet const &a, zet const &b) { return a.val < b.val; }
};
vector<int> currdec;
vector<pair<ll, zet>> st;
vector<pll> dc;

const int N = 60;
zet C[N][N];

zet count(const vector<int> &dec) {
    int sum = 0;
    for (auto i : dec) sum += i;
    zet ans = 1;
    for (auto i : dec) {
        ans *= C[sum][i];
        sum -= i;
    }
    return ans;
}

void rec(int i, ll curr) {
    if (i == sz(dc)) {
        st.pb({curr, count(currdec)});
        return;
    }
    currdec.pb(0);
    for (int j = 0; j <= dc[i].s; ++j) {
        rec(i + 1, curr);
        ++currdec.back();
        curr *= dc[i].f;
    }
    currdec.popb();
}

zet get(ll x) {
    int l = 0, r = sz(st);
    while (r - l > 1) {
        int m = r + l >> 1;
        if (st[m].f > x) r = m;
        else l = m;
    }
    return st[l].s;
}

signed main() {
    FAST; FIXED;
    for (int i = 0; i < N; ++i) C[i][0] = 1;
    for (int i = 1; i < N; ++i)
        for (int j = 1; j < N; ++j)
            C[i][j] = C[i - 1][j] + C[i - 1][j - 1];
    ll D = readULong();
    for (ll i = 2; i * i <= D; ++i) {
        if (D % i == 0) {
            ll cnt = 0;
            while (D % i == 0) D /= i, ++cnt;
            dc.pb({i, cnt});
        }
    }
    if (D > 1) dc.pb({D, 1});
    rec(0, 1);
    sort(all(st), [](const pair<ll, zet> &p1, const pair<ll, zet> &p2) {
        return p1.f < p2.f;
    });
    int q = readUInt();
    while (q--) {
        ll u = readULong(), v = readULong();
        ll g = __gcd(u, v);
        writeInt((get(u / g) * get(v / g)).val);
        writeChar('\n');
    }
    #ifdef DEBUG
        cerr << "Runtime is: " << clock() * 1.0 / CLOCKS_PER_SEC << endl;
    #endif
    return 0;
}


#pragma GCC optimize("O3", "unroll-loops")
#pragma GCC target("avx2")

#include <iostream>
#include <iomanip>
#include <vector>
#include <algorithm>
#include <cmath>
#include <string>
#include <map>
#include <unordered_map>
#include <set>
#include <unordered_set>
#include <bitset>
#include <sstream>
#include <deque>
#include <queue>
#include <complex>
#include <random>
#include <cassert>
#include <chrono>

using namespace std;

#define FAST ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0)
#define FIXED cout << fixed << setprecision(12)
#define ll long long
#define ld long double
#define pii pair<int, int>
#define pll pair<ll, ll>
#define graph vector<vector<int>>
#define pb push_back
#define pf push_front
#define popb pop_back
#define popf pop_front
#define f first
#define s second
#define hashmap unordered_map
#define hashset unordered_set
#define eps 1e-9
#define mod 998244353
#define inf 3000000000000000007ll
#define sz(a) signed(a.size())
#define all(a) a.begin(), a.end()
#define rall(a) a.rbegin(), a.rend()

#ifdef DEBUG
    mt19937 gen(857204);
#else
    mt19937 gen(chrono::high_resolution_clock::now().time_since_epoch().count());
#endif

template<class T, class U> inline void checkmin(T &x, U y) { if (y < x) x = y; }
template<class T, class U> inline void checkmax(T &x, U y) { if (y > x) x = y; }
template<class T, class U> inline bool ifmax(T &x, U y) { if (y > x) return x = y, true; return false; }
template<class T, class U> inline bool ifmin(T &x, U y) { if (y < x) return x = y, true; return false; }
template<class T> inline void sort(T &a) { sort(all(a)); }
template<class T> inline void rsort(T &a) { sort(rall(a)); }
template<class T> inline void reverse(T &a) { reverse(all(a)); }
template<class T, class U> inline istream& operator>>(istream& str, pair<T, U> &p) { return str >> p.f >> p.s; }
template<class T> inline istream& operator>>(istream& str, vector<T> &a) { for (auto &i : a) str >> i; return str; }
template<class T> inline T sorted(T a) { sort(a); return a; }

namespace io {
    using namespace std;
    static
    const int buf_size = 4096;
    static unsigned char buf[buf_size];
    static int buf_len = 0, buf_pos = 0;
    inline bool isEof() {
        if (buf_pos == buf_len) {
            buf_pos = 0, buf_len = fread(buf, 1, buf_size, stdin);
            if (buf_pos == buf_len) return 1;
        }
        return 0;
    }
    inline int getChar() {
        return isEof() ? -1 : buf[buf_pos++];
    }
    inline int peekChar() {
        return isEof() ? -1 : buf[buf_pos];
    }
    inline bool seekEof() {
        int c;
        while ((c = peekChar()) != -1 && c <= 32) buf_pos++;
        return c == -1;
    }
    inline void skipBlanks() {
        while (!isEof() && buf[buf_pos] <= 32U) buf_pos++;
    }
    inline int readChar() {
        int c = getChar();
        while (c != -1 && c <= 32) c = getChar();
        return c;
    }
    inline int readUInt() {
        int c = readChar(), x = 0;
        while ('0' <= c && c <= '9') x = x * 10 + c - '0', c = getChar();
        return x;
    }
    inline ll readULong() {
        int c = readChar();
        ll x = 0;
        while ('0' <= c && c <= '9') x = x * 10 + c - '0', c = getChar();
        return x;
    }
    template < class T = int > inline T readInt() {
        int s = 1, c = readChar();
        T x = 0;
        if (c == '-') s = -1, c = getChar();
        else if (c == '+') c = getChar();
        while ('0' <= c && c <= '9') x = x * 10 + c - '0', c = getChar();
        return s == 1 ? x : -x;
    }
    inline double readDouble() {
        int s = 1, c = readChar();
        double x = 0;
        if (c == '-') s = -1, c = getChar();
        while ('0' <= c && c <= '9') x = x * 10 + c - '0', c = getChar();
        if (c == '.') {
            c = getChar();
            double coef = 1;
            while ('0' <= c && c <= '9') x += (c - '0') * (coef *= 1e-1), c = getChar();
        }
        return s == 1 ? x : -x;
    }
    inline void readWord(char * s) {
        int c = readChar();
        while (c > 32) * s++ = c, c = getChar();* s = 0;
    }
    inline bool readLine(char * s) {
        int c = getChar();
        while (c != '\n' && c != -1) * s++ = c, c = getChar();* s = 0;
        return c != -1;
    }
    static int write_buf_pos = 0;
    static char write_buf[buf_size];
    inline void writeChar(int x) {
        if (write_buf_pos == buf_size) fwrite(write_buf, 1, buf_size, stdout), write_buf_pos = 0;
        write_buf[write_buf_pos++] = x;
    }
    inline void flush() {
        if (write_buf_pos) {
            fwrite(write_buf, 1, write_buf_pos, stdout), write_buf_pos = 0;
            fflush(stdout);
        }
    }
    template < class T > inline void writeInt(T x, char end = 0, int output_len = -1) {
        if (x < 0) writeChar('-'), x = -x;
        char s[24];
        int n = 0;
        while (x || !n) s[n++] = '0' + x % 10, x /= 10;
        while (n < output_len) s[n++] = '0';
        while (n--) writeChar(s[n]);
        if (end) writeChar(end);
    }
    inline void writeWord(const char * s) {
        while ( * s) writeChar( * s++);
    }
    inline void writeDouble(double x, int output_len = 0) {
        if (x < 0) writeChar('-'), x = -x;
        int t = (int) x;
        writeInt(t), x -= t;
        writeChar('.');
        for (int i = output_len - 1; i > 0; i--) {
            x *= 10;
            t = std::min(9, (int) x);
            writeChar('0' + t), x -= t;
        }
        x *= 10;
        t = std::min(9, (int)(x + 0.5));
        writeChar('0' + t);
    }
    static struct buffer_flusher_t {
        ~buffer_flusher_t() {
            flush();
        }
    }
    buffer_flusher;
};

using namespace io;

#include <ext/pb_ds/assoc_container.hpp>
using namespace __gnu_pbds;
struct chash {
    const int RANDOM = gen();
    static unsigned long long hash_f(unsigned long long x) {
        x += 0x9e3779b97f4a7c15;
        x = (x ^ (x >> 30)) * 0xbf58476d1ce4e5b9;
        x = (x ^ (x >> 27)) * 0x94d049bb133111eb;
        return x ^ (x >> 31);
    }
    static unsigned hash_combine(unsigned a, unsigned b) { return a * 31 + b; }
    int operator()(int x) const { return hash_f(x)^RANDOM; }
};
struct zet {
    int val;
    explicit operator int() const { return val; }
    zet(ll x = 0) { val = (x >= -mod && x < mod ? x : x % mod); if (val < 0) val += mod; }
    zet(ll a, ll b) { *this += a; *this /= b; }

    zet& operator+=(zet const &b) { val += b.val; if (val >= mod) val -= mod; return *this; }
    zet& operator-=(zet const &b) { val -= b.val; if (val < 0) val += mod; return *this; }
    zet& operator*=(zet const &b) { val = (val * (ll)b.val) % mod; return *this; }

    friend zet mypow(zet a, ll n) {
        zet res = 1;
        while (n) { if (n & 1) res *= a; a *= a; n >>= 1; }
        return res;
    }
    friend zet inv(zet a) { return mypow(a, mod - 2); }
    zet& operator/=(zet const& b) { return *this *= inv(b); }
    friend zet operator+(zet a, const zet &b) { return a += b; }
    friend zet operator-(zet a, const zet &b) { return a -= b; }
    friend zet operator-(zet a) { return 0 - a; }
    friend zet operator*(zet a, const zet &b) { return a *= b; }
    friend zet operator/(zet a, const zet &b) { return a /= b; }
    friend istream& operator>>(istream& stream, zet &a) { return stream >> a.val; }
    friend ostream& operator<<(ostream& stream, const zet &a) { return stream << a.val; }
    friend bool operator==(zet const &a, zet const &b) { return a.val == b.val; }
    friend bool operator!=(zet const &a, zet const &b) { return a.val != b.val; }
    friend bool operator<(zet const &a, zet const &b) { return a.val < b.val; }
};
vector<int> currdec;
gp_hash_table<ll, zet, chash> st;
vector<pll> dc;

const int N = 200;
zet C[N][N];

zet count(vector<int> dec) {
    int sum = 0;
    for (auto i : dec) sum += i;
    zet ans = 1;
    for (auto i : dec) {
        ans *= C[sum][i];
        sum -= i;
    }
    return ans;
}

void rec(int i, ll curr) {
    if (i == sz(dc)) {
        st[curr] = count(currdec);
        return;
    }
    currdec.pb(0);
    for (int j = 0; j <= dc[i].s; ++j) {
        rec(i + 1, curr);
        ++currdec.back();
        curr *= dc[i].f;
    }
    currdec.popb();
}

signed main() {
    FAST; FIXED;
    for (int i = 0; i < N; ++i) C[i][0] = 1;
    for (int i = 1; i < N; ++i)
        for (int j = 1; j < N; ++j)
            C[i][j] = C[i - 1][j] + C[i - 1][j - 1];
    ll D = readULong();
    for (ll i = 2; i * i <= D; ++i) {
        if (D % i == 0) {
            ll cnt = 0;
            while (D % i == 0) D /= i, ++cnt;
            dc.pb({i, cnt});
        }
    }
    if (D > 1) dc.pb({D, 1});
    rec(0, 1);
    int q = readUInt();
    while (q--) {
        ll u = readULong(), v = readULong();
        ll g = __gcd(u, v);
        writeInt((st[u / g] * st[v / g]).val);
        writeChar('\n');
    }
    #ifdef DEBUG
        cerr << "Runtime is: " << clock() * 1.0 / CLOCKS_PER_SEC << endl;
    #endif
    return 0;
}


#pragma GCC optimize("O3", "unroll-loops")
#pragma GCC target("avx2")

#include <iostream>
#include <iomanip>
#include <vector>
#include <algorithm>
#include <cmath>
#include <string>
#include <map>
#include <unordered_map>
#include <set>
#include <unordered_set>
#include <bitset>
#include <sstream>
#include <deque>
#include <queue>
#include <complex>
#include <random>
#include <cassert>
#include <chrono>

using namespace std;

#define FAST ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0)
#define FIXED cout << fixed << setprecision(12)
#define ll long long
#define ld long double
#define pii pair<int, int>
#define pll pair<ll, ll>
#define graph vector<vector<int>>
#define pb push_back
#define pf push_front
#define popb pop_back
#define popf pop_front
#define f first
#define s second
#define hashmap unordered_map
#define hashset unordered_set
#define eps 1e-9
#define mod 998244353
#define inf 3000000000000000007ll
#define sz(a) signed(a.size())
#define all(a) a.begin(), a.end()
#define rall(a) a.rbegin(), a.rend()

#ifdef DEBUG
    mt19937 gen(857204);
#else
    mt19937 gen(chrono::high_resolution_clock::now().time_since_epoch().count());
#endif

template<class T, class U> inline void checkmin(T &x, U y) { if (y < x) x = y; }
template<class T, class U> inline void checkmax(T &x, U y) { if (y > x) x = y; }
template<class T, class U> inline bool ifmax(T &x, U y) { if (y > x) return x = y, true; return false; }
template<class T, class U> inline bool ifmin(T &x, U y) { if (y < x) return x = y, true; return false; }
template<class T> inline void sort(T &a) { sort(all(a)); }
template<class T> inline void rsort(T &a) { sort(rall(a)); }
template<class T> inline void reverse(T &a) { reverse(all(a)); }
template<class T, class U> inline istream& operator>>(istream& str, pair<T, U> &p) { return str >> p.f >> p.s; }
template<class T> inline istream& operator>>(istream& str, vector<T> &a) { for (auto &i : a) str >> i; return str; }
template<class T> inline T sorted(T a) { sort(a); return a; }

namespace io {
    using namespace std;
    static
    const int buf_size = 4096;
    static unsigned char buf[buf_size];
    static int buf_len = 0, buf_pos = 0;
    inline bool isEof() {
        if (buf_pos == buf_len) {
            buf_pos = 0, buf_len = fread(buf, 1, buf_size, stdin);
            if (buf_pos == buf_len) return 1;
        }
        return 0;
    }
    inline int getChar() {
        return isEof() ? -1 : buf[buf_pos++];
    }
    inline int peekChar() {
        return isEof() ? -1 : buf[buf_pos];
    }
    inline bool seekEof() {
        int c;
        while ((c = peekChar()) != -1 && c <= 32) buf_pos++;
        return c == -1;
    }
    inline void skipBlanks() {
        while (!isEof() && buf[buf_pos] <= 32U) buf_pos++;
    }
    inline int readChar() {
        int c = getChar();
        while (c != -1 && c <= 32) c = getChar();
        return c;
    }
    inline int readUInt() {
        int c = readChar(), x = 0;
        while ('0' <= c && c <= '9') x = x * 10 + c - '0', c = getChar();
        return x;
    }
    inline ll readULong() {
        int c = readChar();
        ll x = 0;
        while ('0' <= c && c <= '9') x = x * 10 + c - '0', c = getChar();
        return x;
    }
    template < class T = int > inline T readInt() {
        int s = 1, c = readChar();
        T x = 0;
        if (c == '-') s = -1, c = getChar();
        else if (c == '+') c = getChar();
        while ('0' <= c && c <= '9') x = x * 10 + c - '0', c = getChar();
        return s == 1 ? x : -x;
    }
    inline double readDouble() {
        int s = 1, c = readChar();
        double x = 0;
        if (c == '-') s = -1, c = getChar();
        while ('0' <= c && c <= '9') x = x * 10 + c - '0', c = getChar();
        if (c == '.') {
            c = getChar();
            double coef = 1;
            while ('0' <= c && c <= '9') x += (c - '0') * (coef *= 1e-1), c = getChar();
        }
        return s == 1 ? x : -x;
    }
    inline void readWord(char * s) {
        int c = readChar();
        while (c > 32) * s++ = c, c = getChar();* s = 0;
    }
    inline bool readLine(char * s) {
        int c = getChar();
        while (c != '\n' && c != -1) * s++ = c, c = getChar();* s = 0;
        return c != -1;
    }
    static int write_buf_pos = 0;
    static char write_buf[buf_size];
    inline void writeChar(int x) {
        if (write_buf_pos == buf_size) fwrite(write_buf, 1, buf_size, stdout), write_buf_pos = 0;
        write_buf[write_buf_pos++] = x;
    }
    inline void flush() {
        if (write_buf_pos) {
            fwrite(write_buf, 1, write_buf_pos, stdout), write_buf_pos = 0;
            fflush(stdout);
        }
    }
    template < class T > inline void writeInt(T x, char end = 0, int output_len = -1) {
        if (x < 0) writeChar('-'), x = -x;
        char s[24];
        int n = 0;
        while (x || !n) s[n++] = '0' + x % 10, x /= 10;
        while (n < output_len) s[n++] = '0';
        while (n--) writeChar(s[n]);
        if (end) writeChar(end);
    }
    inline void writeWord(const char * s) {
        while ( * s) writeChar( * s++);
    }
    inline void writeDouble(double x, int output_len = 0) {
        if (x < 0) writeChar('-'), x = -x;
        int t = (int) x;
        writeInt(t), x -= t;
        writeChar('.');
        for (int i = output_len - 1; i > 0; i--) {
            x *= 10;
            t = std::min(9, (int) x);
            writeChar('0' + t), x -= t;
        }
        x *= 10;
        t = std::min(9, (int)(x + 0.5));
        writeChar('0' + t);
    }
    static struct buffer_flusher_t {
        ~buffer_flusher_t() {
            flush();
        }
    }
    buffer_flusher;
};

using namespace io;

struct zet {
    int val;
    explicit operator int() const { return val; }
    zet(ll x = 0) { val = (x >= -mod && x < mod ? x : x % mod); if (val < 0) val += mod; }
    zet(ll a, ll b) { *this += a; *this /= b; }

    zet& operator+=(zet const &b) { val += b.val; if (val >= mod) val -= mod; return *this; }
    zet& operator-=(zet const &b) { val -= b.val; if (val < 0) val += mod; return *this; }
    zet& operator*=(zet const &b) { val = (val * (ll)b.val) % mod; return *this; }

    friend zet mypow(zet a, ll n) {
        zet res = 1;
        while (n) { if (n & 1) res *= a; a *= a; n >>= 1; }
        return res;
    }
    friend zet inv(zet a) { return mypow(a, mod - 2); }
    zet& operator/=(zet const& b) { return *this *= inv(b); }
    friend zet operator+(zet a, const zet &b) { return a += b; }
    friend zet operator-(zet a, const zet &b) { return a -= b; }
    friend zet operator-(zet a) { return 0 - a; }
    friend zet operator*(zet a, const zet &b) { return a *= b; }
    friend zet operator/(zet a, const zet &b) { return a /= b; }
    friend istream& operator>>(istream& stream, zet &a) { return stream >> a.val; }
    friend ostream& operator<<(ostream& stream, const zet &a) { return stream << a.val; }
    friend bool operator==(zet const &a, zet const &b) { return a.val == b.val; }
    friend bool operator!=(zet const &a, zet const &b) { return a.val != b.val; }
    friend bool operator<(zet const &a, zet const &b) { return a.val < b.val; }
};
vector<int> currdec;
vector<pair<ll, zet>> st;
vector<pll> dc;

const int N = 200;
zet C[N][N];

zet count(vector<int> dec) {
    int sum = 0;
    for (auto i : dec) sum += i;
    zet ans = 1;
    for (auto i : dec) {
        ans *= C[sum][i];
        sum -= i;
    }
    return ans;
}

void rec(int i, ll curr) {
    if (i == sz(dc)) {
        st.pb({curr, count(currdec)});
        return;
    }
    currdec.pb(0);
    for (int j = 0; j <= dc[i].s; ++j) {
        rec(i + 1, curr);
        ++currdec.back();
        curr *= dc[i].f;
    }
    currdec.popb();
}

zet get(ll x) {
    int l = 0, r = sz(st);
    while (r - l > 1) {
        int m = r + l >> 1;
        if (st[m].f > x) r = m;
        else l = m;
    }
    return st[l].s;
}

signed main() {
    FAST; FIXED;
    for (int i = 0; i < N; ++i) C[i][0] = 1;
    for (int i = 1; i < N; ++i)
        for (int j = 1; j < N; ++j)
            C[i][j] = C[i - 1][j] + C[i - 1][j - 1];
    ll D = readULong();
    for (ll i = 2; i * i <= D; ++i) {
        if (D % i == 0) {
            ll cnt = 0;
            while (D % i == 0) D /= i, ++cnt;
            dc.pb({i, cnt});
        }
    }
    if (D > 1) dc.pb({D, 1});
    rec(0, 1);
    sort(st);
    int q = readUInt();
    while (q--) {
        ll u = readULong(), v = readULong();
        ll g = __gcd(u, v);
        writeInt((get(u / g) * get(v / g)).val);
        writeChar('\n');
    }
    #ifdef DEBUG
        cerr << "Runtime is: " << clock() * 1.0 / CLOCKS_PER_SEC << endl;
    #endif
    return 0;
}