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 ep = 1e-6;
const double eps = 4e-5;
const double pi = acos(-1);
int tmpx, tmpy;
struct pnt {
  double x, y;
  pnt(double x = 0, double y = 0) : x(x), y(y) {}
  pnt operator+(const pnt &b) const { return pnt(x + b.x, y + b.y); }
  pnt operator-(const pnt &b) const { return pnt(x - b.x, y - b.y); }
  pnt operator*(const double &b) const { return pnt(x * b, y * b); }
  pnt operator/(const double &b) const { return pnt(x / b, y / b); }
  double operator&(const pnt &b) const { return x * b.x + y * b.y; }
  double operator^(const pnt &b) const { return x * b.y - y * b.x; }
  double dist() { return sqrt(x * x + y * y); }
  void input() { scanf("%d %d", &tmpx, &tmpy), x = tmpx, y = tmpy; }
};
int n, Q;
pnt p[10101 << 1], q;
double s[10101 << 1], area;
void prep() {
  for (int i = 0, j = n - 1; i < j; i++, j--) swap(p[i], p[j]);
  for (int i = 0; i <= n; i++) p[i + n] = p[i];
  s[0] = 0;
  for (int i = 1; i <= 2 * n; i++) s[i] = s[i - 1] + (p[i - 1] ^ p[i]);
  area = s[n];
}
double dist(pnt &p, double &a, double &b, double &c) {
  return p.x * a + p.y * b + c;
}
pnt intersect(pnt &a, pnt &b, double &A, double &B, double &C) {
  double a_ = dist(a, A, B, C);
  double b_ = dist(b, A, B, C);
  return (a * b_ - b * a_) / (b_ - a_);
}
double calc(double alpha) {
  double A = sin(alpha), B = -cos(alpha), C = -A * q.x - B * q.y;
  int st, en, u, v, mid;
  double st_, en_, u_, v_, mid_;
  st = 0, en = n - 1;
  st_ = dist(p[st], A, B, C);
  en_ = dist(p[en], A, B, C);
  while (st < en) {
    u = (st + en - 1) >> 1;
    v = u + 1;
    u_ = dist(p[u], A, B, C);
    v_ = dist(p[v], A, B, C);
    if ((st_ <= en_ && st_ <= v_) || (u_ <= en_ && u_ <= v_))
      en = u;
    else
      st = v;
  }
  int mn = st;
  st = 0, en = n - 1;
  st_ = dist(p[st], A, B, C);
  en_ = dist(p[en], A, B, C);
  while (st < en) {
    u = (st + en - 1) >> 1;
    v = u + 1;
    u_ = dist(p[u], A, B, C);
    v_ = dist(p[v], A, B, C);
    if ((st_ >= en_ && st_ >= v_) || (u_ >= en_ && u_ >= v_))
      en = u;
    else
      st = v;
  }
  int mx = st;
  st = mn, en = mx + n;
  while (st < en - 1) {
    mid = (st + en) >> 1;
    mid_ = dist(p[mid], A, B, C);
    if (mid_ < 0)
      st = mid;
    else
      en = mid;
  }
  int ans1 = st % n;
  pnt crs1 = intersect(p[ans1], p[ans1 + 1], A, B, C);
  st = mx, en = mn + n;
  while (st < en - 1) {
    mid = (st + en) >> 1;
    mid_ = dist(p[mid], A, B, C);
    if (mid_ > 0)
      st = mid;
    else
      en = mid;
  }
  int ans2 = st % n;
  pnt crs2 = intersect(p[ans2], p[ans2 + 1], A, B, C);
  if (ans1 >= ans2) ans2 += n;
  double rlt = (p[ans2] ^ crs2) + (crs2 ^ crs1) + (crs1 ^ p[ans1 + 1]) +
               s[ans2] - s[ans1 + 1];
  if (((crs1 - crs2) & pnt(cos(alpha), sin(alpha))) < 0) rlt = area - rlt;
  return rlt;
}
int main() {
  scanf("%d %d", &n, &Q);
  for (int i = 0; i < n; i++) p[i].input();
  prep();
  while (Q--) {
    q.input();
    double st = 0, en = pi, mid, tmp;
    bool stt = (calc(st) < area / 2), enn = !stt, midd;
    for (int step = 1; step <= 31; step++) {
      mid = (st + en) / 2;
      tmp = calc(mid);
      midd = (tmp < area / 2);
      if (fabs(tmp * 2 - area) / area < eps) break;
      if (midd == stt)
        st = mid;
      else
        en = mid;
    }
    printf("%.20lf\n", (st + en) / 2);
  }
  return 0;
}