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 CPP):

Solution:
#include <bits/stdc++.h>
using namespace std;
const double PI = acos(-1);
const int MX = 10005;
struct Point {
  double x, y;
} pts[2 * MX];
Point operator-(Point a, Point b) {
  a.x -= b.x;
  a.y -= b.y;
  return a;
}
Point operator+(Point a, Point b) {
  a.x += b.x;
  a.y += b.y;
  return a;
}
Point operator*(Point a, double k) {
  a.x *= k;
  a.y *= k;
  return a;
}
double cp(Point a, Point b) { return a.x * b.y - a.y * b.x; }
Point intersection(Point p, Point v, Point q, Point u) {
  double T = (cp(p, v) - cp(q, v)) / cp(u, v);
  return q + u * T;
}
double S[2 * MX];
int n;
double calc(Point pivot, double alpha) {
  Point v = {cos(alpha), sin(alpha)};
  auto getDist = [&](Point p) { return cp(v, p - pivot); };
  int lo = 0, hi = 0;
  {
    int L = 0, R = n - 2;
    while (L <= R) {
      int M = (L + R) / 2;
      bool ok;
      if (getDist(pts[0]) > getDist(pts[n - 1])) {
        ok = getDist(pts[M + 1]) <= getDist(pts[M]) ||
             getDist(pts[M]) >= getDist(pts[0]);
      } else {
        ok = getDist(pts[M + 1]) <= getDist(pts[M]) &&
             getDist(pts[M]) <= getDist(pts[0]);
      }
      if (ok) {
        lo = M + 1;
        L = M + 1;
      } else {
        R = M - 1;
      }
    }
  }
  {
    int L = 0, R = n - 2;
    while (L <= R) {
      int M = (L + R) / 2;
      bool ok;
      if (getDist(pts[0]) < getDist(pts[n - 1])) {
        ok = getDist(pts[M + 1]) >= getDist(pts[M]) ||
             getDist(pts[M]) <= getDist(pts[0]);
      } else {
        ok = getDist(pts[M + 1]) >= getDist(pts[M]) &&
             getDist(pts[M]) >= getDist(pts[0]);
      }
      if (ok) {
        hi = M + 1;
        L = M + 1;
      } else {
        R = M - 1;
      }
    }
  }
  int a = 0, b = 0;
  {
    int L = lo, R = hi;
    if (R <= L) R += n;
    R--;
    while (L <= R) {
      int M = (L + R) / 2;
      if (getDist(pts[M]) < 0) {
        a = M;
        L = M + 1;
      } else {
        R = M - 1;
      }
    }
  }
  {
    int L = hi, R = lo;
    if (R <= L) R += n;
    R--;
    while (L <= R) {
      int M = (L + R) / 2;
      if (getDist(pts[M]) > 0) {
        b = M;
        L = M + 1;
      } else {
        R = M - 1;
      }
    }
  }
  if (a >= n) a -= n;
  if (b >= n) b -= n;
  if (a > b) b += n;
  Point p1 = intersection(pivot, v, pts[a], pts[a + 1] - pts[a]);
  Point p2 = intersection(pivot, v, pts[b], pts[b + 1] - pts[b]);
  return S[b] - S[a + 1] + cp(pts[a + 1], p1) + cp(p1, p2) + cp(p2, pts[b]);
}
int main() {
  int q;
  ignore = scanf("%d %d", &n, &q);
  for (int i = 0; i < n; i++) {
    ignore = scanf("%lf %lf", &pts[i].x, &pts[i].y);
  }
  reverse(pts, pts + n);
  for (int i = 0; i < n; i++) {
    pts[i + n] = pts[i];
  }
  for (int i = 1; i < 2 * n; i++) {
    S[i] = S[i - 1] + cp(pts[i], pts[i - 1]);
  }
  double total = S[n];
  while (q--) {
    Point p;
    ignore = scanf("%lf %lf", &p.x, &p.y);
    double L = 0, R = PI;
    bool sgn = (2.0 * calc(p, 0) - total) >= 0.0;
    for (int rep = 0; rep < 50; rep++) {
      double M = (L + R) / 2;
      double tmp = 2.0 * calc(p, M) - total;
      if ((tmp >= 0) == sgn) {
        L = M;
      } else {
        R = M;
      }
    }
    printf("%.15lf\n", (L + R) / 2);
  }
}