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;
inline int read() {
  int s = 0, w = 1;
  char ch = getchar();
  while (ch < '0' || ch > '9') {
    if (ch == '-') w = -1;
    ch = getchar();
  }
  while ('0' <= ch && ch <= '9')
    s = (s << 1) + (s << 3) + (ch ^ 48), ch = getchar();
  return s * w;
}
struct Node {
  double x, y;
} aa[20010], a[20010], t;
double operator*(const Node &A, const Node &B) { return A.x * B.y - A.y * B.x; }
Node operator-(const Node &A, const Node &B) {
  return (Node){A.x - B.x, A.y - B.y};
}
const double pi = acos(-1.0), eps = 1e-10;
int n, q, tot, pos;
double sum[20010], delta;
inline double calc(Node A, Node B) {
  double tt = atan2(B.y - A.y, B.x - A.x);
  if (tt >= 0)
    return tt;
  else
    return 2 * pi + tt;
}
inline double add(double x, double y) {
  return x + y >= 2 * pi ? x + y - 2 * pi : x + y;
}
inline double Tan(double k) {
  if (k <= pi)
    return tan(k);
  else
    return tan(k - 2 * pi);
}
inline Node get(double k, Node p1, Node p2) {
  if (fabs(k) < eps || fabs(k - pi) < eps) {
    if (p1.x == p2.x) return (Node){p1.x, t.y};
    double k1 = (p1.y - p2.y) / (p1.x - p2.x);
    return (Node){p1.x + (t.y - p1.y) / k1, t.y};
  }
  if (fabs(k - pi / 2) < eps || fabs(k - pi / 2 * 3) < eps) {
    if (p1.y == p2.y) return (Node){t.x, p1.y};
    double k1 = (p1.y - p2.y) / (p1.x - p2.x);
    return (Node){t.x, p1.y - k1 * p1.x + k1 * t.x};
  }
  double k1 = Tan(k), b1 = t.y - k1 * t.x;
  if (p1.x == p2.x) return (Node){p1.x, k1 * p1.x + b1};
  double k2 = (p1.y - p2.y) / (p1.x - p2.x), b2 = p1.y - k2 * p1.x;
  double x = (b2 - b1) / (k1 - k2), y = k1 * x + b1;
  return (Node{x, y});
}
inline double f(double k) {
  double F = 0;
  k = add(k, delta);
  int l = 1, r = pos;
  while (l < r) {
    int mid = (l + r + 1) >> 1;
    double tmp = calc(t, a[mid]);
    if ((k >= delta && (delta <= tmp && tmp <= k)) ||
        (k < delta && (delta <= tmp || tmp <= k)))
      l = mid;
    else
      r = mid - 1;
  }
  F += sum[l] + fabs((a[l] - t) * (a[1] - t)) / 2;
  Node tmp = get(k, a[l], a[l + 1]);
  F += fabs((a[l] - t) * (tmp - t)) / 2;
  k = add(k, pi);
  l = pos, r = n;
  while (l < r) {
    int mid = (l + r + 1) >> 1;
    double tmp = calc(t, a[mid]);
    if ((k >= delta && (tmp <= delta || tmp >= k) ||
         (k < delta && (tmp <= delta && tmp >= k))))
      r = mid - 1;
    else
      l = mid;
  }
  l++;
  F += sum[n] - sum[l] + fabs((a[l] - t) * (a[1] - t)) / 2;
  tmp = get(k, a[l], a[l - 1]);
  F += fabs((a[l] - t) * (tmp - t)) / 2;
  return sum[n] - 2 * F;
}
int main() {
  n = read(), q = read();
  for (int i = 1; i <= n; i++) aa[i].x = read(), aa[i].y = read();
  reverse(aa + 1, aa + n + 1);
  int p = 1;
  for (int i = 2; i <= n; i++)
    if (aa[i].x < aa[p].x || (aa[i].x == aa[p].x && aa[i].y < aa[p].y)) p = i;
  for (int i = p; i <= n; i++) a[++tot] = aa[i];
  for (int i = 1; i < p; i++) a[++tot] = aa[i];
  for (int i = 3; i <= n; i++)
    sum[i] = sum[i - 1] + fabs((a[i] - a[1]) * (a[i - 1] - a[1])) / 2;
  a[n + 1] = a[1], sum[n + 1] = sum[n];
  int cnt = 0, Q = q;
  while (q--) {
    t.x = read(), t.y = read();
    delta = calc(t, a[1]);
    int L = 1, R = n;
    while (L < R) {
      int mid = (L + R + 1) >> 1;
      if ((t - a[1]) * (t - a[mid]) >= 0)
        L = mid;
      else
        R = mid - 1;
    }
    pos = L;
    double l = 0, r = pi, fl = f(l);
    while (1) {
      double mid = (l + r) / 2.0, fmid = f(mid);
      if (fabs(fmid) / sum[n] <= 1e-4) {
        l = mid;
        break;
      }
      if (fl * fmid <= 0)
        r = mid;
      else
        l = mid, fl = fmid;
    }
    if (l >= pi) l -= pi;
    if (delta >= pi) delta -= pi;
    printf("%.10lf\n", l + delta >= pi ? l + delta - pi : l + delta);
  }
  return 0;
}