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;
struct Point {
  double x, y;
  Point(double ix = 0, double iy = 0) {
    x = ix;
    y = iy;
  }
};
inline Point operator+(Point a, Point b) { return Point(a.x + b.x, a.y + b.y); }
inline Point operator-(Point a, Point b) { return Point(a.x - b.x, a.y - b.y); }
inline double cross(Point a, Point b) { return a.x * b.y - a.y * b.x; }
inline double dot(Point a, Point b) { return a.x * b.x + a.y * b.y; }
const int N = 100004;
const double EPS = 1e-9;
const double PI = acos(-1.0);
double area[N];
int n, q, nxt[N];
Point center, p[N];
inline double getArea(Point a, Point b) {
  return (b.x - a.x) * (a.y + b.y) / 2;
}
inline double getAreaRange(int l, int r) {
  if (l == r) return 0.0;
  if (l > r) r += n;
  if (l == 0) return area[r - 1];
  return area[r - 1] - area[l - 1];
}
inline bool getIntersection(Point a, Point b, Point dir, double &s, double &t) {
  double a11 = b.x - a.x;
  double a21 = b.y - a.y;
  double a12 = -dir.x;
  double a22 = -dir.y;
  double det = a11 * a22 - a12 * a21;
  if (abs(det) < EPS) return false;
  s = ((center.x - a.x) * a22 - (center.y - a.y) * a12) / det;
  t = ((center.y - a.y) * a11 - (center.x - a.x) * a21) / det;
  return true;
}
inline void getPolygonRayIntersection(Point dir, int &ind, Point &u) {
  double s, t, ss, tt;
  bool flg = getIntersection(p[0], p[1], dir, s, t);
  int lo = 0, hi = n - 1;
  if (flg) {
    if (s < 0 && t > 0) {
      while (lo < hi) {
        int mi = (lo + hi + 1) / 2;
        bool tmp = getIntersection(p[mi], p[nxt[mi]], dir, ss, tt);
        if (tmp) {
          if (ss > 0 && tt < 0) {
            lo = mi;
          } else if (ss < 0 && tt < 0) {
            lo = mi;
          } else if (ss > 0 && tt > 0) {
            lo = mi;
          } else {
            if (t < tt) {
              lo = mi;
            } else {
              hi = mi - 1;
            }
          }
        } else {
          lo = mi;
        }
      }
    } else if (s > 0 && t < 0) {
      while (lo < hi) {
        int mi = (lo + hi + 1) / 2;
        bool tmp = getIntersection(p[mi], p[nxt[mi]], dir, ss, tt);
        if (tmp) {
          if (ss < 0 && tt < 0) {
            lo = mi;
          } else if (ss > 0 && tt > 0) {
            lo = mi;
          } else if (ss < 0 && tt > 0) {
            hi = mi - 1;
          } else {
            if (t < tt) {
              lo = mi;
            } else {
              hi = mi - 1;
            }
          }
        } else {
          if (dot(p[nxt[mi]] - p[mi], dir) > 0) {
            lo = mi;
          } else {
            hi = mi - 1;
          }
        }
      }
    } else if (s < 0 && t < 0) {
      while (lo < hi) {
        int mi = (lo + hi + 1) / 2;
        bool tmp = getIntersection(p[mi], p[nxt[mi]], dir, ss, tt);
        if (tmp) {
          if (ss > 0 && tt > 0) {
            lo = mi;
          } else if (ss < 0 && tt > 0) {
            hi = mi - 1;
          } else if (ss > 0 && tt < 0) {
            hi = mi - 1;
          } else {
            if (t < tt) {
              hi = mi - 1;
            } else {
              lo = mi;
            }
          }
        } else {
          if (dot(p[nxt[mi]] - p[mi], dir) > 0) {
            lo = mi;
          } else {
            hi = mi - 1;
          }
        }
      }
    } else {
      while (lo < hi) {
        int mi = (lo + hi + 1) / 2;
        bool tmp = getIntersection(p[mi], p[nxt[mi]], dir, ss, tt);
        if (tmp) {
          if (ss < 0 && tt > 0) {
            hi = mi - 1;
          } else if (ss > 0 && tt < 0) {
            hi = mi - 1;
          } else if (ss < 0 && tt < 0) {
            hi = mi - 1;
          } else {
            if (t < tt) {
              hi = mi - 1;
            } else {
              lo = mi;
            }
          }
        } else {
          hi = mi - 1;
        }
      }
    }
  } else if (dot(p[1] - p[0], dir) > 0) {
    while (lo < hi) {
      int mi = (lo + hi + 1) / 2;
      bool tmp = getIntersection(p[mi], p[nxt[mi]], dir, ss, tt);
      if (tmp) {
        if (ss > 0 && tt > 0) {
          lo = mi;
        } else {
          hi = mi - 1;
        }
      } else {
        hi = mi - 1;
      }
    }
  } else {
    while (lo < hi) {
      int mi = (lo + hi + 1) / 2;
      bool tmp = getIntersection(p[mi], p[nxt[mi]], dir, ss, tt);
      if (tmp) {
        if (ss < 0 && tt > 0) {
          hi = mi - 1;
        } else {
          lo = mi;
        }
      } else {
        lo = mi;
      }
    }
  }
  ind = lo;
  getIntersection(p[lo], p[nxt[lo]], dir, s, t);
  u.x = center.x + dir.x * t;
  u.y = center.y + dir.y * t;
}
inline double getAreaDiff(double ang) {
  Point u, v;
  int up, dw;
  double cosang = cos(ang);
  double sinang = sin(ang);
  Point dir(cosang, sinang);
  getPolygonRayIntersection(dir, up, u);
  dir.x = -cosang;
  dir.y = -sinang;
  getPolygonRayIntersection(dir, dw, v);
  double ret = getAreaRange(nxt[up], dw) + getArea(p[dw], v) + getArea(v, u) +
               getArea(u, p[nxt[up]]);
  ret = ret * 2 - area[n - 1];
  return ret;
}
inline double query(double x, double y) {
  double lo = 0, hi = PI;
  center.x = x;
  center.y = y;
  double areadiffref = getAreaDiff(lo);
  if (abs(areadiffref) < EPS) return lo;
  for (int it = 0; it < 40; it++) {
    double mi = (lo + hi) / 2;
    double areadiffmi = getAreaDiff(mi);
    if (abs(areadiffmi) < EPS) return mi;
    if (areadiffref > 0) {
      if (areadiffmi > 0) {
        lo = mi;
      } else {
        hi = mi;
      }
    } else {
      if (areadiffmi < 0) {
        lo = mi;
      } else {
        hi = mi;
      }
    }
  }
  return lo;
}
int main() {
  ios::sync_with_stdio(false);
  cin.tie(nullptr);
  cin >> n >> q;
  for (int i = 0; i < n; i++) {
    cin >> p[i].x >> p[i].y;
    nxt[i] = (i + 1) % n;
  }
  reverse(p, p + n);
  for (int i = 0; i < 2 * n; i++) {
    area[i] = getArea(p[i % n], p[(i + 1) % n]);
    if (i) area[i] += area[i - 1];
  }
  cout << setprecision(30);
  while (q--) {
    double x, y;
    cin >> x >> y;
    cout << query(x, y) << '\n';
  }
  return 0;
}