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;
template <class C>
constexpr int sz(const C &c) {
  return int(c.size());
}
using ll = long long;
constexpr const char nl = '\n', sp = ' ';
using T = double;
using pt = complex<T>;
const T EPS = 1e-9, PI = acos(T(-1));
bool lt(T a, T b) { return a < b - EPS; }
bool le(T a, T b) { return !lt(b, a); }
bool gt(T a, T b) { return lt(b, a); }
bool ge(T a, T b) { return !lt(a, b); }
bool eq(T a, T b) { return !lt(a, b) && !lt(b, a); }
bool ne(T a, T b) { return lt(a, b) || lt(b, a); }
template <class T>
int sgn(const T &a) {
  return lt(a, 0) ? -1 : gt(a, 0) ? +1 : 0;
}
T cross(const pt &a, const pt &b) {
  return a.real() * b.imag() - a.imag() * b.real();
}
T area2(const pt &a, const pt &b, const pt &c) { return cross(b - a, c - a); }
int ccw(const pt &a, const pt &b, const pt &c) { return sgn(area2(a, b, c)); }
T dist(const pt &a, const pt &b) { return abs(b - a); }
pt perp(const pt &a) { return pt(-a.imag(), a.real()); }
istream &operator>>(istream &stream, pt &p) {
  T X, Y;
  stream >> X >> Y;
  p.real(X);
  p.imag(Y);
  return stream;
}
ostream &operator<<(ostream &stream, const pt &p) {
  return stream << fixed << setprecision(9) << p.real() << ' ' << p.imag();
}
struct Line {
  pt v;
  T c;
  Line(T a = 0, T b = 0, T c = 0) : v(b, -a), c(c) {}
  Line(const pt &v, T c) : v(v), c(c) {}
  Line(const pt &p, const pt &q) : v(q - p), c(cross(v, p)) {}
  T eval(const pt &p) const { return cross(v, p) - c; }
  int onLeft(const pt &p) const { return sgn(eval(p)); }
};
int inter(const Line &l1, const Line &l2, pt &res) {
  T d = cross(l1.v, l2.v);
  if (eq(d, 0)) return l2.v * l1.c == l1.v * l2.c ? 2 : 0;
  res = (l2.v * l1.c - l1.v * l2.c) / d;
  return 1;
}
using Polygon = vector<pt>;
int extremeVertex(const Polygon &poly, const pt &dir) {
  int n = int(poly.size()), lo = 0, hi = n;
  pt pp = perp(dir);
  auto mod = [&](int i) { return i >= n ? i - n : i; };
  auto cmp = [&](int i, int j) {
    return sgn(cross(pp, poly[mod(i)] - poly[mod(j)]));
  };
  auto extr = [&](int i) {
    return cmp(i + 1, i) >= 0 && cmp(i, i + n - 1) < 0;
  };
  if (extr(0)) return 0;
  while (lo + 1 < hi) {
    int m = lo + (hi - lo) / 2;
    if (extr(m)) return m;
    int ls = cmp(lo + 1, lo), ms = cmp(m + 1, m);
    (ls < ms || (ls == ms && ls == cmp(lo, m)) ? hi : lo) = m;
  }
  return lo;
}
pair<int, int> lineConvexPolyInter(const Polygon &poly, const Line &line) {
  int n = int(poly.size()), endA = extremeVertex(poly, -perp(line.v)),
      endB = extremeVertex(poly, perp(line.v));
  auto cmpL = [&](int i) { return line.onLeft(poly[i]); };
  auto mod = [&](int i) { return i >= n ? i - n : i; };
  pair<int, int> ret(-1, -1);
  if (cmpL(endA) > 0 || cmpL(endB) < 0) return ret;
  for (int i = 0; i < 2; i++) {
    int lo = endB, hi = endA;
    while (mod(lo + 1) != hi) {
      int m = mod((lo + hi + (lo < hi ? 0 : n)) / 2);
      (cmpL(m) == cmpL(endB) ? lo : hi) = m;
    }
    (i == 0 ? ret.first : ret.second) = mod(lo + !cmpL(hi));
    swap(endA, endB);
  }
  if (ret.first == ret.second) return make_pair(ret.first, -1);
  if (!cmpL(ret.first) && !cmpL(ret.second)) {
    switch (mod(ret.first - ret.second + n + 1)) {
      case 0:
        return make_pair(ret.first, ret.first);
      case 2:
        return make_pair(ret.second, ret.second);
    }
  }
  return ret;
}
const int MAXN = 2e4 + 5;
const pt O(0, 0);
int N, Q;
T A[MAXN * 4];
Polygon poly;
T getA(int i) { return i < 0 ? 0 : A[i]; }
T area2(int l, int r) {
  if (l > r) r += N;
  if (l == r) return 0;
  return getA(r - 1) - getA(l - 1);
}
int getInd(int i) { return i % N; }
pt getPt(int i) { return poly[getInd(i)]; }
T f(pt p, T ang) {
  pt q = p + polar(T(10), ang);
  Line line(p, q);
  int i, j;
  tie(i, j) = lineConvexPolyInter(poly, line);
  pt a, b;
  inter(Line(getPt(i), getPt(i + 1)), line, a);
  inter(Line(getPt(j), getPt(j + 1)), line, b);
  T a1 = area2(i + 1, j) + cross(getPt(j), b) + cross(b, a) +
         cross(a, getPt(i + 1));
  T a2 = area2(j + 1, i) + cross(getPt(i), a) + cross(a, b) +
         cross(b, getPt(j + 1));
  return a1 - a2;
}
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  cin >> N >> Q;
  for (int i = 0; i < N; i++) {
    pt p;
    cin >> p;
    poly.push_back(p);
  }
  reverse(poly.begin(), poly.end());
  for (int i = 0; i < N * 4; i++) A[i] = cross(getPt(i), getPt(i + 1));
  partial_sum(A, A + N * 4, A);
  for (int i = 0; i < Q; i++) {
    pt p;
    cin >> p;
    T lo = 0, hi = PI;
    bool s = lt(f(p, lo), f(p, hi));
    for (int it = 0; it < 40; it++) {
      T mid = lo + (hi - lo) / 2;
      if (ge(f(p, mid), 0) == s)
        hi = mid;
      else
        lo = mid;
    }
    if (eq(lo, PI)) lo = 0;
    cout << fixed << setprecision(12) << lo << nl;
  }
  return 0;
}