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.), eps = 1e-9, inf = 1e9 + 9;
const int bound = 50;
struct point {
  double x, y, theta;
};
point poly[10011], now, tmp[10100];
double sum[30011];
int n, num_q;
double compute(double dx, double dy, double theta) {
  int i, j, s, p, q, low, high, mid, l_id, r_id, ch[2];
  double x1, y1, x2, y2, A, B, ru, ret = 0;
  point ll, rr;
  low = 0;
  high = n - 1;
  while (low <= high) {
    mid = (low + high) >> 1;
    if (poly[mid].theta >= theta)
      low = mid + 1;
    else
      high = mid - 1;
  }
  r_id = low % n;
  low = 0;
  high = n - 1;
  while (low <= high) {
    mid = (low + high) >> 1;
    if (poly[mid].theta >= theta - pi)
      low = mid + 1;
    else
      high = mid - 1;
  }
  l_id = low % n;
  low = l_id;
  high = r_id - 1;
  if (low > high) high += n;
  while (low <= high) {
    mid = (low + high) >> 1;
    x1 = poly[mid % n].x;
    y1 = poly[mid % n].y;
    x2 = poly[(mid + 1) % n].x;
    y2 = poly[(mid + 1) % n].y;
    A = (x2 - x1) * dy - (y2 - y1) * dx;
    B = (now.x - x1) * dy - (now.y - y1) * dx;
    ru = B / A;
    if (ru > 1 + eps)
      low = mid + 1;
    else if (ru < -eps)
      high = mid - 1;
    else {
      ch[0] = mid % n;
      break;
    }
  }
  low = r_id;
  high = l_id - 1;
  if (low > high) high += n;
  while (low <= high) {
    mid = (low + high) >> 1;
    x1 = poly[mid % n].x;
    y1 = poly[mid % n].y;
    x2 = poly[(mid + 1) % n].x;
    y2 = poly[(mid + 1) % n].y;
    A = (x2 - x1) * dy - (y2 - y1) * dx;
    B = (now.x - x1) * dy - (now.y - y1) * dx;
    ru = B / A;
    if (ru > 1 + eps)
      low = mid + 1;
    else if (ru < -eps)
      high = mid - 1;
    else {
      ch[1] = mid % n;
      break;
    }
  }
  for (i = 0; i < 2; i++) {
    x1 = poly[ch[i]].x;
    y1 = poly[ch[i]].y;
    x2 = poly[(ch[i] + 1) % n].x;
    y2 = poly[(ch[i] + 1) % n].y;
    A = (x2 - x1) * dy - (y2 - y1) * dx;
    B = (now.x - x1) * dy - (now.y - y1) * dx;
    ru = B / A;
    if (i == 0) {
      ll.x = x1 + ru * (x2 - x1);
      ll.y = y1 + ru * (y2 - y1);
    } else {
      rr.x = x1 + ru * (x2 - x1);
      rr.y = y1 + ru * (y2 - y1);
    }
  }
  l_id = ch[0];
  r_id = ch[1];
  if (l_id > r_id) r_id += n;
  if (l_id + 2 <= r_id) ret = sum[r_id] - sum[l_id + 1];
  x1 = ll.x;
  y1 = ll.y;
  x2 = poly[(ch[0] + 1) % n].x;
  y2 = poly[(ch[0] + 1) % n].y;
  ret += x1 * y2 - x2 * y1;
  x1 = poly[ch[1]].x;
  y1 = poly[ch[1]].y;
  x2 = rr.x;
  y2 = rr.y;
  ret += x1 * y2 - x2 * y1;
  x1 = rr.x;
  y1 = rr.y;
  x2 = ll.x;
  y2 = ll.y;
  ret += x1 * y2 - x2 * y1;
  l_id = ch[1];
  r_id = ch[0];
  if (l_id > r_id) r_id += n;
  if (l_id + 2 <= r_id) ret -= sum[r_id] - sum[l_id + 1];
  x1 = rr.x;
  y1 = rr.y;
  x2 = poly[(ch[1] + 1) % n].x;
  y2 = poly[(ch[1] + 1) % n].y;
  ret -= x1 * y2 - x2 * y1;
  x1 = poly[ch[0]].x;
  y1 = poly[ch[0]].y;
  x2 = ll.x;
  y2 = ll.y;
  ret -= x1 * y2 - x2 * y1;
  x1 = ll.x;
  y1 = ll.y;
  x2 = rr.x;
  y2 = rr.y;
  ret -= x1 * y2 - x2 * y1;
  return ret;
}
int main() {
  int i, j, s, p, q;
  double x1, y1, x2, y2, dtheta = pi / bound, theta, vl, mi, ch;
  scanf("%d%d", &n, &num_q);
  for (i = 0; i < n; i++) scanf("%lf%lf", &poly[i].x, &poly[i].y);
  mi = inf;
  for (i = 0; i < n; i++) {
    x1 = poly[i].x;
    y1 = poly[i].y;
    x2 = poly[(i + 1) % n].x;
    y2 = poly[(i + 1) % n].y;
    vl = atan2(y2 - y1, x2 - x1);
    if (mi > vl)
      mi = vl;
    else
      break;
  }
  if (i != 0) {
    for (j = i; j < i + n; j++) tmp[j - i] = poly[j % n];
    for (j = 0; j < n; j++) poly[j] = tmp[j];
  }
  for (i = 0; i < n; i++)
    poly[i].theta =
        atan2(poly[(i + 1) % n].y - poly[i].y, poly[(i + 1) % n].x - poly[i].x);
  sum[0] = 0;
  for (i = 1; i <= 2 * n; i++) {
    x1 = poly[(i - 1) % n].x;
    y1 = poly[(i - 1) % n].y;
    x2 = poly[i % n].x;
    y2 = poly[i % n].y;
    sum[i] = sum[i - 1] + x1 * y2 - x2 * y1;
  }
  while (num_q--) {
    scanf("%lf%lf", &now.x, &now.y);
    double lw = compute(cos(0.), sin(0.), 0),
           rw = compute(cos(pi), sin(pi), pi), low, high, mid;
    low = 0;
    high = pi;
    for (int it = 0; it < 40; it++) {
      mid = 0.5 * (low + high);
      vl = compute(cos(mid), sin(mid), mid);
      if ((vl < 0 && lw > 0) || (vl > 0 && lw < 0))
        high = mid;
      else
        low = mid;
    }
    vl = compute(cos(0.5 * (low + high)), sin(0.5 * (low + high)),
                 0.5 * (low + high));
    printf("%.20f\n", 0.5 * (low + high));
  }
  return 0;
}