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; }
const int N = 10004;
const double PI = acos(-1.0);
const double EPS = 1e-9;
Point p[N];
double area[N];
int n, q, nxt[N], prv[N];
inline int func(int i, int j, Point dir) {
  double tmp = (p[j].x - p[i].x) * dir.x + (p[j].y - p[i].y) * dir.y;
  if (abs(tmp) < EPS) return 0;
  if (tmp > 0) return 1;
  return -1;
}
inline bool isExtreme(int i, Point dir) {
  int tmp1 = func(prv[i], i, dir);
  int tmp2 = func(i, nxt[i], dir);
  if (tmp1 >= 0 && tmp2 == -1) return true;
  if (tmp1 == 1 && tmp2 <= 0) return true;
  return false;
}
inline int getExtreme(double ang) {
  Point dir(cos(ang), sin(ang));
  if (isExtreme(0, dir)) return 0;
  if (isExtreme(1, dir)) return 1;
  if (func(0, 1, dir) == -1) {
    int lo = 0, hi = n - 1;
    while (lo < hi) {
      int mi = (lo + hi) / 2;
      if (isExtreme(mi, dir)) return mi;
      int tmp = func(mi, nxt[mi], dir);
      if (tmp >= 0) {
        lo = mi + 1;
      } else {
        if (func(0, mi, dir) == -1) {
          lo = mi + 1;
        } else {
          hi = mi;
        }
      }
    }
    return lo;
  } else if (func(0, 1, dir) == 1) {
    int lo = 0, hi = n - 1;
    while (lo < hi) {
      int mi = (lo + hi) / 2;
      if (isExtreme(mi, dir)) return mi;
      int tmp = func(mi, nxt[mi], dir);
      if (tmp <= 0) {
        hi = mi;
      } else {
        if (func(0, mi, dir) == 1) {
          lo = mi + 1;
        } else {
          hi = mi;
        }
      }
    }
    return lo;
  } else {
    int lo = 0, hi = n - 1;
    while (lo < hi) {
      int mi = (lo + hi) / 2;
      if (isExtreme(mi, dir)) return mi;
      int tmp = func(mi, nxt[mi], dir);
      if (tmp == 1) {
        lo = mi + 1;
      } else {
        hi = mi;
      }
    }
    return lo;
  }
}
inline double getArea(Point a, Point b) {
  return (b.x - a.x) * (b.y + a.y) / 2;
}
inline double getAreaRange(int l, int r) {
  if (l == r) return 0.0;
  if (l < r) {
    if (l > 0) {
      return area[r - 1] - area[l - 1];
    } else {
      return area[r - 1];
    }
  }
  if (r == 0) return area[n - 1] - area[l - 1];
  return area[n - 1] - area[l - 1] + area[r - 1];
}
inline bool getIntersection(Point a, Point b, Point c, Point d, Point &p) {
  double a11 = b.x - a.x;
  double a12 = c.x - d.x;
  double a21 = b.y - a.y;
  double a22 = c.y - d.y;
  double det = a11 * a22 - a12 * a21;
  if (abs(det) < EPS) return false;
  double s = ((c.x - a.x) * a22 - (c.y - a.y) * a12) / det;
  p.x = a.x + (b.x - a.x) * s;
  p.y = a.y + (b.y - a.y) * s;
  return true;
}
Point center;
inline double getAreaDiff(double x, double y, double ang) {
  int a = getExtreme(ang - PI / 2);
  int b = getExtreme(ang + PI / 2);
  Point dir(cos(ang), sin(ang));
  Point u, v;
  int up, dw;
  {
    int lo = a, hi = b;
    while (lo != hi) {
      int mi;
      if (lo < hi) {
        mi = (lo + hi + 1) / 2;
      } else {
        mi = (lo + hi + n + 1) / 2;
        if (mi >= n) mi -= n;
      }
      double tmp = cross(p[mi] - center, dir);
      if (tmp < 0) {
        hi = prv[mi];
      } else {
        lo = mi;
      }
    }
    up = lo;
    getIntersection(p[up], p[nxt[up]], center, center + dir, u);
  }
  dir.x = -dir.x;
  dir.y = -dir.y;
  {
    int lo = b, hi = a;
    while (lo != hi) {
      int mi;
      if (lo < hi) {
        mi = (lo + hi + 1) / 2;
      } else {
        mi = (lo + hi + n + 1) / 2;
        if (mi >= n) mi -= n;
      }
      double tmp = cross(p[mi] - center, dir);
      if (tmp < 0) {
        hi = prv[mi];
      } else {
        lo = mi;
      }
    }
    dw = lo;
    getIntersection(p[dw], p[nxt[dw]], center, center + dir, v);
  }
  double tot = 0.0;
  tot += getAreaRange(nxt[up], dw) + getArea(p[dw], v) + getArea(v, u) +
         getArea(u, p[nxt[up]]);
  tot -= getAreaRange(nxt[dw], up) + getArea(p[up], u) + getArea(u, v) +
         getArea(v, p[nxt[dw]]);
  return tot;
}
inline double query(double x, double y) {
  double lo = -PI / 2;
  double hi = +PI / 2;
  center.x = x;
  center.y = y;
  double areadifflo = getAreaDiff(x, y, lo);
  for (int it = 0; it < 35; it++) {
    double mi = (lo + hi) / 2;
    double tmp = getAreaDiff(x, y, mi);
    if (abs(tmp) < EPS) {
      if (mi < 0) return mi + PI;
      return mi;
    }
    if (areadifflo > 0) {
      if (tmp < 0) {
        hi = mi;
      } else {
        lo = mi;
        areadifflo = tmp;
      }
    } else {
      if (tmp < 0) {
        lo = mi;
        areadifflo = tmp;
      } else {
        hi = mi;
      }
    }
  }
  if (lo < 0) return lo + PI;
  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) ? (i + 1) : 0;
    prv[nxt[i]] = i;
  }
  reverse(p, p + n);
  for (int i = 0; i < n; i++) {
    area[i] = getArea(p[i], p[nxt[i]]);
    if (i > 0) area[i] += area[i - 1];
  }
  while (q--) {
    double x, y;
    cin >> x >> y;
    cout << setprecision(30) << query(x, y) << '\n';
  }
  return 0;
}