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 int MX = 10005;
const double EPS = 1e-8;
struct Point {
  double x, y;
};
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;
}
Point operator-(Point a, Point b) {
  a.x -= b.x;
  a.y -= b.y;
  return a;
}
void Read(Point& p) {
  int x, y;
  ignore = scanf("%d %d", &x, &y);
  p.x = x;
  p.y = y;
}
double cp(Point a, Point b) { return a.x * b.y - a.y * b.x; }
double dist(Point p, Point v, Point q) { return (cp(p, v) - cp(q, v)); }
Point intersect(Point p, Point v, Point q, Point u) {
  double T = (cp(p, v) - cp(q, v)) / cp(u, v);
  return q + u * T;
}
Point p[2 * MX];
int n;
double S[2 * MX];
double Calc(Point q, double alpha) {
  Point v = {cos(alpha), sin(alpha)};
  int low, high;
  {
    if (dist(q, v, p[0]) >= dist(q, v, p[n - 1])) {
      high = 0;
    } else {
      high = n - 1;
    }
    int L = 0, R = n - 2;
    while (L <= R) {
      int M = (L + R) / 2;
      bool good;
      if (dist(q, v, p[0]) >= dist(q, v, p[n - 1])) {
        good = (dist(q, v, p[M + 1]) >= dist(q, v, p[M]) &&
                dist(q, v, p[M + 1]) >= dist(q, v, p[0]));
      } else {
        good = (dist(q, v, p[M + 1]) >= dist(q, v, p[M]) ||
                dist(q, v, p[M + 1]) <= dist(q, v, p[0]));
      }
      if (good) {
        L = M + 1;
        high = M + 1;
      } else {
        R = M - 1;
      }
    }
  }
  {
    if (dist(q, v, p[0]) <= dist(q, v, p[n - 1])) {
      low = 0;
    } else {
      low = n - 1;
    }
    int L = 0, R = n - 2;
    while (L <= R) {
      int M = (L + R) / 2;
      bool good;
      if (dist(q, v, p[0]) <= dist(q, v, p[n - 1])) {
        good = (dist(q, v, p[M + 1]) <= dist(q, v, p[M]) &&
                dist(q, v, p[M + 1]) <= dist(q, v, p[0]));
      } else {
        good = (dist(q, v, p[M + 1]) <= dist(q, v, p[M]) ||
                dist(q, v, p[M + 1]) >= dist(q, v, p[0]));
      }
      if (good) {
        L = M + 1;
        low = M + 1;
      } else {
        R = M - 1;
      }
    }
  }
  int left, right;
  {
    int L = low, R = high;
    if (R < L) R += n;
    left = L;
    while (L <= R) {
      int M = (L + R) / 2;
      if (dist(q, v, p[M]) <= 0) {
        left = M;
        L = M + 1;
      } else {
        R = M - 1;
      }
    }
  }
  {
    int L = high, R = low;
    if (R < L) R += n;
    right = L;
    while (L <= R) {
      int M = (L + R) / 2;
      if (dist(q, v, p[M]) >= 0) {
        right = M;
        L = M + 1;
      } else {
        R = M - 1;
      }
    }
  }
  if (left >= n) left -= n;
  if (right >= n) right -= n;
  if (right < left) right += n;
  double res = S[right] - S[left + 1];
  Point p0 = intersect(q, v, p[left], p[left + 1] - p[left]);
  Point p1 = intersect(q, v, p[right], p[right + 1] - p[right]);
  res += cp(p[right], p1);
  res += cp(p1, p0);
  res += cp(p0, p[left + 1]);
  return res;
}
int main() {
  int q;
  ignore = scanf("%d %d", &n, &q);
  for (int i = 0; i < n; i++) Read(p[i]);
  reverse(p, p + n);
  for (int i = 0; i < n; i++) {
    p[i + n] = p[i];
  }
  for (int i = 1; i < 2 * n; i++) {
    S[i] = S[i - 1] + cp(p[i - 1], p[i]);
  }
  double total = S[n];
  while (q--) {
    Point P;
    Read(P);
    double L = 0, R = acos(-1);
    double tmp = Calc(P, 0);
    if (abs(total - 2 * tmp) < EPS) {
      printf("%.15lf\n", 0.0);
      continue;
    }
    bool left_above = (total - 2 * tmp > 0);
    for (int rep = 0; rep < 60; rep++) {
      double M = (L + R) / 2;
      tmp = Calc(P, M);
      if (abs(total - 2 * tmp) < EPS) break;
      bool above = (total - 2 * tmp > 0);
      if (above == left_above) {
        L = M;
      } else {
        R = M;
      }
    }
    printf("%.15lf\n", (L + R) / 2);
  }
}