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 N = 200005;
int n, q;
const double PI = std::acos(-1);
struct Point {
  double x, y;
};
inline Point operator+(const Point &a, const Point &b) {
  return {a.x + b.x, a.y + b.y};
}
inline Point operator-(const Point &a, const Point &b) {
  return {a.x - b.x, a.y - b.y};
}
inline Point operator*(const Point &a, double b) { return {a.x * b, a.y * b}; }
inline Point operator/(const Point &a, double b) { return {a.x / b, a.y / b}; }
inline double cross(const Point &a, const Point &b) {
  return a.x * b.y - a.y * b.x;
}
inline double dot(const Point &a, const Point &b) {
  return a.x * b.x + a.y * b.y;
}
const double EPS = 1e-8;
Point a[N], p;
double s[N];
inline Point intersect(Point p, Point v, Point q, Point u) {
  return q + u * ((cross(p, v) - cross(q, v)) / cross(u, v));
}
double calc(double m) {
  Point v = {cos(m), sin(m)};
  auto dis = [&](Point pp) { return cross(v, pp - p); };
  int l = 0, r = n - 2, lp = 0, rp = 0;
  while (l <= r) {
    int mid = (l + r) >> 1;
    bool ok;
    if (dis(a[0]) > dis(a[n - 1]))
      ok = dis(a[mid + 1]) <= dis(a[mid]) || dis(a[mid]) >= dis(a[0]);
    else
      ok = dis(a[mid + 1]) <= dis(a[mid]) && dis(a[mid]) <= dis(a[0]);
    if (ok)
      lp = l = mid + 1;
    else
      r = mid - 1;
  }
  l = 0, r = n - 2;
  while (l <= r) {
    int mid = (l + r) >> 1;
    bool ok;
    if (dis(a[0]) < dis(a[n - 1]))
      ok = dis(a[mid + 1]) >= dis(a[mid]) || dis(a[mid]) <= dis(a[0]);
    else
      ok = dis(a[mid + 1]) >= dis(a[mid]) && dis(a[mid]) >= dis(a[0]);
    if (ok)
      rp = l = mid + 1;
    else
      r = mid - 1;
  }
  int t1 = 0, t2 = 0;
  l = lp, r = rp;
  if (r <= l) r += n;
  --r;
  while (l <= r) {
    int mid = (l + r) >> 1;
    if (dis(a[mid]) < 0)
      t1 = mid, l = mid + 1;
    else
      r = mid - 1;
  }
  l = rp, r = lp;
  if (r <= l) r += n;
  --r;
  while (l <= r) {
    int mid = (l + r) >> 1;
    if (dis(a[mid]) > 0)
      t2 = mid, l = mid + 1;
    else
      r = mid - 1;
  }
  if (t1 >= n) t1 -= n;
  if (t2 >= n) t2 -= n;
  if (t1 > t2) t2 += n;
  Point p1 = intersect(p, v, a[t1], a[t1 + 1] - a[t1]);
  Point p2 = intersect(p, v, a[t2], a[t2 + 1] - a[t2]);
  return s[t2] - s[t1 + 1] + cross(a[t1 + 1], p1) + cross(p1, p2) +
         cross(p2, a[t2]);
}
int main() {
  ios::sync_with_stdio(false);
  scanf("%d%d", &n, &q);
  for (int i = 0; i < n; i++) scanf("%lf%lf", &a[i].x, &a[i].y);
  reverse(a, a + n);
  for (int i = 0; i < n; i++) a[i + n] = a[i];
  for (int i = 1; i < n * 2; i++) s[i] = s[i - 1] + cross(a[i], a[i - 1]);
  double tot = s[n];
  for (int _ = 1; _ <= q; _++) {
    scanf("%lf%lf", &p.x, &p.y);
    double l = 0, r = PI;
    bool sgn = calc(0) * 2 >= tot;
    for (int _ = 1; _ <= 60; _++) {
      double mid = (l + r) / 2;
      double tmp = calc(mid) * 2;
      if ((tmp >= tot) == sgn)
        l = mid;
      else
        r = mid;
    }
    printf("%.15lf\n", (l + r) / 2);
  }
  return 0;
}