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 INF = 1.01e9;
const double PI = acos(-1);
bool eq(double A, double B) { return abs(A - B) < 1e-9; }
bool ls(double A, double B) { return A < B && !eq(A, B); }
bool le(double A, double B) { return A < B || eq(A, B); }
struct pt {
  double x, y, id;
  pt() {}
  pt(double xx, double yy) : x(xx), y(yy) {}
  pt operator+(pt A) { return pt(x + A.x, y + A.y); }
  pt operator-(pt A) { return pt(x - A.x, y - A.y); }
  pt operator*(double k) { return pt(x * k, y * k); }
  pt operator/(double k) {
    assert(abs(k) > 1e-20);
    return pt(x / k, y / k);
  }
  double operator*(pt A) { return x * A.y - y * A.x; }
  double operator%(pt A) { return x * A.x + y * A.y; }
  bool operator==(pt A) { return eq(x, A.x) && eq(y, A.y); }
  bool operator!=(pt A) { return !eq(x, A.x) || !eq(y, A.y); }
  double len() { return sqrt(x * x + y * y); }
  double len2() { return x * x + y * y; }
  pt rotate() { return pt(-y, x); }
  pt norm() { return (*this) / len(); }
  bool operator<(pt A) { return x < A.x || (eq(x, A.x) && ls(y, A.y)); }
  void read() { scanf("%lf%lf", &x, &y); }
  void Epr() { cerr << "x y: " << x << " " << y << endl; }
};
struct Line {
  pt O, v;
  Line(pt A, pt B) : O(A), v((B - A).norm()) {}
  pt operator*(Line l) {
    pt u = l.v.rotate();
    double t = (l.O - O) % u / (v % u);
    return O + v * t;
  }
};
int main() {
  int n, q;
  scanf("%d%d", &n, &q);
  vector<pt> p(n);
  for (int i = 0; i < n; i++) {
    p[i].read();
  }
  reverse((p).begin(), p.end());
  int idMn = 0;
  int idMx = 0;
  for (int i = 0; i < n; i++) {
    if (p[i] < p[idMn]) {
      idMn = i;
    }
    if (p[idMx] < p[i]) {
      idMx = i;
    }
  }
  vector<double> tr(n);
  vector<double> prefArea(n + 1);
  auto getTrap = [&](pt A, pt B) { return (A.x - B.x) * (A.y + B.y) / 2; };
  for (int i = 0; i < n; i++) {
    tr[i] = getTrap(p[i], p[(i + 1) % n]);
    prefArea[i + 1] = prefArea[i] + tr[i];
  }
  for (int i = 0; i < n; i++) p[i].id = i;
  vector<pt> part[2];
  for (int tt = 0; tt < 2; tt++) {
    for (int i = idMn; i != idMx; i = (i + 1) % n) {
      part[tt].push_back(p[i]);
    }
    part[tt].push_back(p[idMx]);
    swap(idMn, idMx);
  }
  auto getFarPoint = [&](pt v) {
    int where = 0;
    int tt;
    if (v.y < 0) {
      tt = 0;
    } else {
      tt = 1;
    }
    int l = 0;
    int r = part[tt].size() - 1;
    while (r - l > 3) {
      int m1 = (l + l + r) / 3;
      int m2 = (l + r + r) / 3;
      if (part[tt][m1] % v > part[tt][m2] % v) {
        r = m2;
      } else {
        l = m1;
      }
    }
    for (int i = l; i <= r; i++) {
      if (part[tt][i] % v > p[where] % v) {
        where = part[tt][i].id;
      }
    }
    return where;
  };
  auto getSegArea = [&](int l, int r) {
    l %= n;
    r %= n;
    if (l <= r) {
      return prefArea[r] - prefArea[l];
    }
    return prefArea[n] - prefArea[l] + prefArea[r];
  };
  auto getArea = [&](pt O, double ang) {
    pt v(cos(ang), sin(ang));
    pt u = v.rotate();
    int p1 = getFarPoint(u);
    int p2 = getFarPoint(u * -1);
    int ret[2];
    for (int tt = 0; tt < 2; tt++) {
      int l = p2;
      int r = p1;
      assert(l != r);
      if (r < l) {
        r += n;
      }
      while (r - l > 1) {
        if ((p[(l + r) / 2 % n] - O) * v > 0) {
          l = (l + r) / 2;
        } else {
          r = (l + r) / 2;
        }
      }
      ret[tt] = l;
      v = v * -1;
      swap(p1, p2);
    }
    pt G1 = Line(p[ret[0] % n], p[(ret[0] + 1) % n]) * Line(O, O + v);
    pt G2 = Line(p[ret[1] % n], p[(ret[1] + 1) % n]) * Line(O, O + v);
    double res = 0;
    res += getSegArea((ret[0] + 1) % n, ret[1]);
    res += getTrap(p[ret[1] % n], G2);
    res += getTrap(G2, G1);
    res += getTrap(G1, p[(ret[0] + 1) % n]);
    return res;
  };
  for (int tt = 0; tt < q; tt++) {
    pt O;
    O.read();
    double l, r;
    double res = getArea(O, 0);
    if (res * 2 < prefArea.back()) {
      l = 0;
      r = PI;
    } else {
      l = PI;
      r = PI * 2;
    }
    for (int it = 0; it < 40; it++) {
      double tmp = getArea(O, (l + r) / 2);
      if (tmp * 2 < prefArea.back()) {
        l = (l + r) / 2;
      } else {
        r = (l + r) / 2;
      }
    }
    double ang = (l + r) / 2;
    if (ang > PI) {
      ang -= PI;
    }
    printf("%.17f\n", ang);
  }
  return 0;
}