Problem: Arkady reached the n-th level in Township game, so Masha decided to bake a pie for him! Of course, the pie has a shape of convex n-gon, i.e. a polygon with n vertices.

Arkady decided to cut the pie in two equal in area parts by cutting it by a straight line, so that he can eat one of them and give the other to Masha. There is a difficulty because Arkady has already put a knife at some point of the pie, so he now has to cut the pie by a straight line passing trough this point.

Help Arkady: find a line that passes through the point Arkady has put a knife into and cuts the pie into two parts of equal area, or determine that it's impossible. Your program has to quickly answer many queries with the same pie, but different points in which Arkady puts a knife.

Input

The first line contains two integers n and q (3 ≤ n ≤ 104, 1 ≤ q ≤ 105) — the number of vertices in the pie and the number of queries.

n line follow describing the polygon vertices in clockwise order. The i-th of these line contains two integers xi and yi ( - 106 ≤ xi, yi ≤ 106) — the coordinates of the i-th vertex. It is guaranteed that the polygon is strictly convex, in particular, no three vertices line on the same line.

An empty line follows.

q lines follow describing the query points. The i-th of these lines contain two integers xi and yi ( - 106 ≤ xi, yi ≤ 106) — the coordinates of the point in which Arkady puts the knife in the i-th query. In is guaranteed that in each query the given point is strictly inside the polygon, in particular, is not on its edges.

Output

For each query print single integer — the polar angle of the line that is the answer for the corresponding query, in radians. The angle should be in the segment [0;π], the angles are measured from the direction of OX axis in counter-clockwise order. For example, the polar angle of the OY axis is <image>. If there is no answer in that query, print -1.

If there are several answers, print any of them. Your answer is considered correct if the difference between the areas of the parts divided by the total area of the polygon doesn't exceed 10 - 4 by absolute value. In other words, if a and b are the areas of the parts after the cut, then your answer is correct if and only of <image>.

Examples

Input

3 1
0 0
0 3
3 0

1 1


Output

2.67794504460098710000


Input

5 3
6 5
6 3
5 0
0 0
0 5

5 4
3 3
5 2


Output

0.60228734612690049000
1.27933953226473580000
2.85805511179015910000

Solution (in JAVA):

Solution:
import java.io.BufferedWriter;
import java.io.IOException;
import java.io.OutputStreamWriter;
import java.io.PrintWriter;
import java.util.Arrays;

public class Test {

  static PrintWriter writer =
      new PrintWriter(new BufferedWriter(new OutputStreamWriter(System.out)));
  final int N = 31234;
  int n, q;
  double[] x = new double[N], y = new double[N], areas = new double[N];
  double E = 1e-4;
  int C = 45;
  double[] p = new double[2];

  public static void main(String[] args) {
    Test te = new Test();
    te.start();
    writer.flush();
  }

  int readInt() {
    int ans = 0;
    boolean neg = false;
    try {
      boolean start = false;
      for (int c = 0; (c = System.in.read()) != -1; ) {
        if (c == '-') {
          start = true;
          neg = true;
          continue;
        } else if (c >= '0' && c <= '9') {
          start = true;
          ans = ans * 10 + c - '0';
        } else if (start) break;
      }
    } catch (IOException e) {
    }
    return neg ? -ans : ans;
  }

  long readLong() {
    long ans = 0;
    boolean neg = false;
    try {
      boolean start = false;
      for (int c = 0; (c = System.in.read()) != -1; ) {
        if (c == '-') {
          start = true;
          neg = true;
          continue;
        } else if (c >= '0' && c <= '9') {
          start = true;
          ans = ans * 10 + c - '0';
        } else if (start) break;
      }
    } catch (IOException e) {
    }
    return neg ? -ans : ans;
  }

  String readLine() {
    StringBuilder b = new StringBuilder();
    try {
      for (int c = 0; (c = System.in.read()) != -1; ) {
        if (c == '\n') {
          break;
        } else {
          b.append((char) (c));
        }
      }
    } catch (IOException e) {
    }
    return b.toString().trim();
  }

  void getP(double v, double[] p) {
    int i = (int) v;
    double r = v - i;
    p[0] = (1.0 - r) * x[i] + r * x[i + 1];
    p[1] = (1.0 - r) * y[i] + r * y[i + 1];
  }

  double clockwise(double cx, double cy, double ax, double ay, double bx, double by) {
    ax -= cx;
    ay -= cy;
    bx -= cx;
    by -= cy;
    return Math.signum(ax * by - ay * bx);
  }

  double searchP(double cx, double cy, double ax, double ay, double ll, double rr) {
    getP(ll, p);
    double clk = clockwise(cx, cy, ax, ay, p[0], p[1]);
    double a = ll, b = rr;
    int cnt = C;
    while (cnt-- > 0) {
      double m = (b + a) / 2;
      getP(m, p);
      double clock = clockwise(cx, cy, ax, ay, p[0], p[1]);
      if (clock == 0) {
        b = m;
        break;
      }
      if (clock == clk) a = m;
      else b = m;
    }
    return b;
  }

  void start() {
    n = readInt();
    q = readInt();
    double llx = Double.MAX_VALUE, lly = Double.MAX_VALUE;
    int llp = 0;
    for (int i = 0; i < n; i++) {
      x[i] = readInt();
      y[i] = readInt();
      x[n + i] = x[i];
      y[n + i] = y[i];
      x[n + n + i] = x[i];
      y[n + n + i] = y[i];
      if (y[i] < lly || y[i] == lly && x[i] < llx) {
        lly = y[i];
        llx = x[i];
        llp = i;
      }
    }
    for (int i = llp + 2; i < n + llp; i++)
      areas[i] = areas[i - 1] + triArea(x[llp], y[llp], x[i - 1], y[i - 1], x[i], y[i]);
    double total = areas[n + llp - 1];
    Arrays.fill(areas, n + llp, areas.length, total);
    while (q-- > 0) {
      double cx = readInt(), cy = readInt();
      double rrp = searchP(cx, cy, llx, lly, llp + 1, llp + n - 1);
      getP(rrp, p);
      int rrpi = (int) rrp + 1;
      double ha = triArea(llx, lly, p[0], p[1], x[rrpi], y[rrpi]) + total - areas[rrpi];
      double sign = Math.signum(total - ha - ha);
      boolean found = false;
      double ansx = 0, ansy = 0;
      if (sign == 0) {
        found = true;
        ansx = llx;
        ansy = lly;
      }
      double ll = llp, rr = rrp;
      while (!found) {
        double m = (rr + ll) / 2;
        getP(m, p);
        double x0 = p[0], y0 = p[1];
        double p1 = searchP(cx, cy, x0, y0, rrp, llp + n);
        getP(p1, p);
        double x1 = p[0], y1 = p[1];
        int mi = (int) m;
        int pi = (int) p1 + 1;
        double ar =
            areas[mi]
                + triArea(llx, lly, x[mi], y[mi], x0, y0)
                + triArea(llx, lly, x0, y0, x1, y1)
                + triArea(llx, lly, x1, y1, x[pi], y[pi])
                + total
                - areas[pi];
        double diff = total - ar - ar;
        if (Math.abs(diff) < E * total) {
          found = true;
          ansx = x0;
          ansy = y0;
          break;
        }
        double signnew = Math.signum(diff);
        if (sign == signnew) ll = m;
        else rr = m;
      }
      if (!found) writer.println(-1);
      else {
        double d = Math.atan2(ansy - cy, ansx - cx);
        if (d < 0) d += Math.PI;
        writer.println(d);
      }
    }
  }

  double triArea(double ax, double ay, double bx, double by, double cx, double cy) {
    double ret = ax * (by - cy) + bx * (cy - ay) + cx * (ay - by);
    return Math.abs(ret);
  }
}