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 maxn = 10010;
const double zero = 1e-15;
const double PI = acos(-1.0);
struct Tpoint {
  double x, y;
} p[maxn * 2 + 1], O, d;
int n, Q, K;
double f[maxn + 1][16];
double totArea = 0;
double jiao[maxn + 1];
int jiaocnt[maxn + 1];
int jiaonow;
double angle(Tpoint &a, Tpoint &b) {
  double x = b.x - a.x;
  double y = b.y - a.y;
  double len = sqrt(x * x + y * y);
  double ag = acos(x / len);
  if (y < -zero) ag = 2 * PI - ag;
  return ag;
}
double zhao(int t) {
  if (jiaocnt[t] < jiaonow) {
    jiaocnt[t] = jiaonow;
    jiao[t] = angle(O, p[t]);
  }
  return jiao[t];
}
double cj(Tpoint &a, Tpoint &b, Tpoint &c) {
  return (b.x - a.x) * (c.y - a.y) - (b.y - a.y) * (c.x - a.x);
}
double area(Tpoint &a, Tpoint &b, Tpoint &c) { return fabs(cj(a, b, c) / 2.0); }
void init() {
  int i;
  scanf("%d%d", &n, &Q);
  for (i = n; i >= 1; --i) {
    scanf("%lf%lf", &p[i].x, &p[i].y);
    p[i + n] = p[i];
  }
}
void calc_totarea() {
  int i;
  totArea = 0;
  for (i = 2; i < n; ++i) totArea += area(p[1], p[i], p[i + 1]);
}
void calc_f() {
  int i, j, k, k2;
  for (i = 1; i <= n; ++i) f[i][0] = 0;
  for (j = 1; (1 << j) < n; ++j) {
    for (i = 1; i <= n; ++i) {
      k = i + (1 << (j - 1));
      if (k > n) k -= n;
      k2 = i + (1 << j);
      if (k2 > n) k2 -= n;
      f[i][j] = f[i][j - 1] + f[k][j - 1] + area(p[i], p[k], p[k2]);
    }
  }
}
void work() {
  int i;
  jiaonow = 0;
  for (i = 1; i <= n; ++i) jiaocnt[i] = 0;
  calc_totarea();
  calc_f();
}
Tpoint calc_jd(int i) {
  Tpoint delta, jd;
  delta.x = p[i + 1].x - p[i].x;
  delta.y = p[i + 1].y - p[i].y;
  double t = (delta.y * (p[i].x - O.x) - delta.x * (p[i].y - O.y)) /
             (d.x * delta.y - d.y * delta.x);
  jd.x = O.x + t * d.x;
  jd.y = O.y + t * d.y;
  return jd;
}
double zai(double a, double b, double alpha) {
  if (a < b && alpha >= a - zero && alpha < b) return true;
  if (a > b && (alpha >= a - zero || alpha < b)) return true;
  return false;
}
int find_i(double alpha) {
  int start, stop, mid;
  double q;
  int i;
  if (zai(zhao(K), zhao(K + 1), alpha)) return K;
  if (zai(zhao(n), zhao(1), alpha)) return n;
  if (alpha >= zhao(1) - zero && alpha <= zhao(K) + zero) {
    start = 1;
    stop = K;
  } else {
    start = K + 1;
    stop = n;
  }
  while (start <= stop) {
    mid = (start + stop) / 2;
    q = zhao(mid);
    if (alpha >= q - zero) {
      i = mid;
      start = mid + 1;
    } else {
      stop = mid - 1;
    }
  }
  return i;
}
void calc_K() {
  int start, stop, mid;
  int i;
  double a1 = zhao(1);
  start = 1;
  stop = n;
  while (start <= stop) {
    mid = (start + stop) / 2;
    if (zhao(mid) >= a1 - zero) {
      K = mid;
      start = mid + 1;
    } else {
      stop = mid - 1;
    }
  }
}
void calc_i_p(double alpha, int &i, Tpoint &jd) {
  i = find_i(alpha);
  d.x = cos(alpha);
  d.y = sin(alpha);
  jd = calc_jd(i);
}
int jl(int a, int b) {
  if (b >= a)
    return b - a;
  else
    return b + n - a;
}
double gao(double alpha) {
  int i, j, k, prev, now;
  double t;
  Tpoint p1, p2;
  double mj = 0;
  calc_K();
  calc_i_p(alpha, i, p1);
  t = alpha + PI;
  if (t > 2 * PI) t -= 2 * PI;
  calc_i_p(t, j, p2);
  mj += area(O, p[i + 1], p1);
  mj += area(O, p[j], p2);
  mj += area(O, p[i + 1], p[j]);
  ++i;
  if (i > n) i -= n;
  prev = i;
  for (k = 15; k >= 0; --k) {
    if ((1 << k) <= jl(prev, j)) {
      mj += f[prev][k];
      now = prev + (1 << k);
      if (now > n) now -= n;
      mj += area(p[i], p[prev], p[now]);
      prev = now;
    }
  }
  return mj - (totArea - mj);
}
void output() {
  int w, s, i, j;
  double a0, a;
  double start, stop, mid;
  for (w = 1; w <= Q; ++w) {
    scanf("%lf%lf", &O.x, &O.y);
    ++jiaonow;
    a0 = gao(0);
    if (fabs(a0) < 1e-5) {
      printf("0\n");
      continue;
    }
    start = 0;
    stop = PI;
    for (s = 1; s <= 55; ++s) {
      mid = (start + stop) / 2;
      a = gao(mid);
      if ((a0 < 0 && a < -1e-5) || (a0 > 0 && a > 1e-5))
        start = mid;
      else
        stop = mid;
    }
    printf("%.16lf\n", start);
  }
}
int main() {
  init();
  work();
  output();
  return 0;
}