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;
bool debug = 0;
int n, m, k;
int dx[4] = {0, 1, 0, -1}, dy[4] = {1, 0, -1, 0};
string direc = "RDLU";
long long ln, lk, lm;
void etp(bool f = 0) {
  puts(f ? "YES" : "NO");
  exit(0);
}
void addmod(int &x, int y, int mod = 1000000007) {
  x += y;
  if (x >= mod) x -= mod;
  assert(x >= 0 && x < mod);
}
void et() {
  puts("-1");
  exit(0);
}
struct Point {
  long double x, y;
  Point() {}
  Point(long double x, long double y) : x(x), y(y) {}
  long double abs() const { return hypot(x, y); }
  long double arg() const { return atan2(y, x); }
  Point operator*(double o) const { return Point(x * o, y * o); }
  Point operator+(const Point &o) const { return Point(x + o.x, y + o.y); }
  Point operator-(const Point &o) const { return Point(x - o.x, y - o.y); }
  bool operator<(const Point &o) const {
    return x < o.x - 1e-9 || (x < o.x + 1e-9 && y < o.y - 1e-9);
  }
  friend bool operator==(const Point &r1, const Point &r2) {
    return r1.x == r2.x && r1.y == r2.y;
  }
  Point scale(double o) const { return *this * (o / abs()); }
  Point rotY() const { return Point(-y, x); }
  Point rotX() const { return Point(y, -x); }
  long double cross(Point b) const { return x * b.y - b.x * y; }
  long double dot(Point b) const { return x * b.x + y * b.y; }
  long double disToSeg(Point &a, Point &b) {
    return fabs(((*this) - a).cross(b - a) / (b - a).abs());
  }
  void readin() { scanf("%Lf%Lf", &x, &y); }
};
inline int dcmp(long double x) {
  return fabsl(x) < 1e-9 ? 0 : (x > 0 ? 1 : -1);
}
struct Line {
  Point s, t;
  Line() {}
  Line(Point p, Point q) {
    s = p;
    t = q;
  }
  bool isPointOnSeg(Point p) {
    return dcmp((p - s).cross(t - s)) == 0 &&
           dcmp((p.x - s.x) * (p.x - t.x)) <= 0 &&
           dcmp((p.y - s.y) * (p.y - t.y)) <= 0;
  }
  Point crossPoint(Line b) {
    return s +
           (t - s) * ((b.t - b.s).cross(s - b.s) / (t - s).cross(b.t - b.s));
  }
};
Point a[20105], aa[20105], z;
long double ps[20105];
int bi, ei;
long double geta(int x, int y) {
  return ps[y] - ps[x] - (a[y] - a[1]).cross(a[x] - a[1]) / 2;
}
int cal(long double x) {
  Point vec = Point(-cos(x), -sin(x));
  int l = bi, r = ei;
  while (l < r) {
    int mid = (l + r + 1) / 2;
    if (dcmp((a[mid] - z).cross(vec)) <= 0)
      l = mid;
    else
      r = mid - 1;
  }
  int p1 = l;
  vec = Point(-vec.x, -vec.y);
  for (l = ei, r = bi + n; l < r;) {
    int mid = (l + r + 1) / 2;
    if (dcmp((a[mid] - z).cross(vec)) <= 0)
      l = mid;
    else
      r = mid - 1;
  }
  int p2 = l;
  long double ss =
      p2 + 1 - n > 0 ? geta(p2 + 1 - n, p1) : ps[n] - geta(p1, p2 + 1);
  Point q1, q2;
  Point tmp = z + vec;
  Line fline = Line(tmp, z);
  Line ln1 = Line(a[p1], a[p1 + 1]);
  q1 = fline.crossPoint(ln1);
  ln1 = Line(a[p2], a[p2 + 1]);
  q2 = fline.crossPoint(ln1);
  ss +=
      ((a[p2 + 1] - a[p1]).cross(q2 - a[p1]) + (q1 - q2).cross(a[p1] - q2)) / 2;
  return dcmp(ss - (ps[n] - ss));
}
void fmain(int tid) {
  scanf("%d%d", &n, &m);
  for (int(i) = 1; (i) <= (int)(n); (i)++) aa[i].readin();
  int be = 1, ed = 1;
  for (int(i) = 1; (i) <= (int)(n); (i)++) {
    if (aa[i].y > aa[be].y || (aa[i].y == aa[be].y && aa[i].x < aa[be].x))
      be = i;
    if (aa[i].y < aa[ed].y || (aa[i].y == aa[ed].y && aa[i].x > aa[ed].x))
      ed = i;
  }
  ed -= be - 1;
  if (ed <= 0) ed += n;
  for (int i = be; i <= n; i++) a[i - be + 1] = aa[i];
  for (int i = 1; i < be; i++) a[n - be + 1 + i] = aa[i];
  for (int(i) = 1; (i) <= (int)(n); (i)++) a[i + n] = a[i];
  for (int i = 3; i <= n; i++) {
    ps[i] = ps[i - 1] + (a[i] - a[1]).cross(a[i - 1] - a[1]) / 2;
  }
  for (int(i) = 1; (i) <= (int)(m); (i)++) {
    z.readin();
    int l, r;
    for (l = 1 + (a[1].y == a[2].y), r = ed - 1; l < r;) {
      int mid = (l + r + 1) / 2;
      if (a[mid].y >= z.y)
        l = mid;
      else
        r = mid - 1;
    }
    bi = l;
    for (l = ed + (a[ed].y == a[ed + 1].y), r = n; l < r;) {
      int mid = (l + r + 1) / 2;
      if (a[mid].y <= z.y)
        l = mid;
      else
        r = mid - 1;
    }
    ei = l;
    int p = cal(0);
    if (p == 0) {
      puts("0");
      continue;
    }
    long double L = 0, R = acos(-1);
    for (int i = 0; i < 60 && L < R; i++) {
      long double mid = (L + R) / 2;
      if (cal(mid) == p)
        L = mid;
      else
        R = mid;
    }
    printf("%.16Lf\n", L);
  }
}
int main() {
  int t = 1;
  for (int(i) = 1; (i) <= (int)(t); (i)++) {
    fmain(i);
  }
  return 0;
}