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;

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[] point = 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 updatePoint(double v) {
    int i = (int) v;
    v -= i;
    point[0] = (1.0 - v) * x[i] + v * x[i + 1];
    point[1] = (1.0 - v) * y[i] + v * y[i + 1];
  }

  double clock(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 searchLineTo(double cx, double cy, double ax, double ay, double ll, double rr) {
    updatePoint(ll);
    double begin = clock(cx, cy, ax, ay, point[0], point[1]);
    double a = ll, b = rr;
    int cnt = C;
    while (cnt-- > 0) {
      double m = (b + a) / 2;
      updatePoint(m);
      double now = clock(cx, cy, ax, ay, point[0], point[1]);
      if (now == 0) {
        a = b = m;
        break;
      }
      if (now == begin) a = m;
      else b = m;
    }
    return (b + a) / 2;
  }

  void start() {
    n = readInt();
    q = readInt();
    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];
    }
    for (int i = 1; i < n + n + n; i++)
      areas[i] = areas[i - 1] + (x[i] - x[i - 1]) * (y[i] + y[i - 1]);
    double total = areas[n];
    while (q-- > 0) {
      double cx = readInt(), cy = readInt();
      double to = searchLineTo(cx, cy, x[0], y[0], 1, n - 1);
      updatePoint(to);
      int ti = (int) to;
      double half =
          areas[ti]
              + (point[0] - x[ti]) * (point[1] + y[ti])
              + (x[0] - point[0]) * (y[0] + point[1]);
      double sign = Math.signum(total - half - half);
      boolean found = false;
      double ansx = 0, ansy = 0;
      if (sign == 0) {
        found = true;
        ansx = x[0];
        ansy = y[0];
      }
      double ll = 0, rr = to;
      while (!found) {
        double m = (rr + ll) / 2;
        updatePoint(m);
        double x0 = point[0], y0 = point[1];
        double t1 = searchLineTo(cx, cy, x0, y0, to, n);
        updatePoint(t1);
        double x1 = point[0], y1 = point[1];
        int mi = (int) m + 1;
        ti = (int) t1;
        half =
            (x[mi] - x0) * (y[mi] + y0)
                + areas[ti]
                - areas[mi]
                + (x1 - x[ti]) * (y1 + y[ti])
                + (x0 - x1) * (y0 + y1);
        double diff = total - half - half;
        if (Math.abs(diff) < E * total) {
          ansx = x0;
          ansy = y0;
          break;
        }
        double signNow = Math.signum(diff);
        if (sign == signNow) ll = m;
        else rr = m;
      }
      double d = Math.atan2(ansy - cy, ansx - cx);
      if (d < 0) d += Math.PI;
      writer.println(d);
    }
  }
}