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;
using ld = long double;
constexpr const char nl = '\n', sp = ' ';
using T = double;
constexpr const T EPS = 1e-9;
bool lt(T a, T b) { return a + EPS < b; }
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); }
int sgn(T a) { return lt(a, 0) ? -1 : lt(0, a) ? 1 : 0; }
template <class F>
struct Functor {
  F f;
  Functor(F f) : f(f) {}
  template <class U>
  bool operator()(const U &a, const U &b) const {
    return f(a, b);
  }
};
template <class F>
Functor<F> makeFunctor(F f) {
  return Functor<F>(f);
}
using pt = complex<T>;
istream &operator>>(istream &stream, pt &p) {
  T X, Y;
  stream >> X >> Y;
  p = pt(X, Y);
  return stream;
}
ostream &operator<<(ostream &stream, const pt &p) {
  return stream << p.real() << ' ' << p.imag();
}
bool operator<(const pt &a, const pt &b) {
  return eq(a.real(), b.real()) ? lt(a.imag(), b.imag())
                                : lt(a.real(), b.real());
}
bool operator<=(const pt &a, const pt &b) { return !(b < a); }
bool operator>(const pt &a, const pt &b) { return b < a; }
bool operator>=(const pt &a, const pt &b) { return !(a < b); }
bool operator==(const pt &a, const pt &b) { return !(a < b) && !(b < a); }
bool operator!=(const pt &a, const pt &b) { return a < b || b < a; }
struct pt_lt {
  bool operator()(const pt &a, const pt &b) const { return a < b; }
};
struct pt_le {
  bool operator()(const pt &a, const pt &b) const { return a <= b; }
};
struct pt_gt {
  bool operator()(const pt &a, const pt &b) const { return a > b; }
};
struct pt_ge {
  bool operator()(const pt &a, const pt &b) const { return a >= b; }
};
struct pt_eq {
  bool operator()(const pt &a, const pt &b) const { return a == b; }
};
struct pt_ne {
  bool operator()(const pt &a, const pt &b) const { return a != b; }
};
T dot(const pt &a, const pt &b) {
  return a.real() * b.real() + a.imag() * b.imag();
}
T cross(const pt &a, const pt &b) {
  return a.real() * b.imag() - a.imag() * b.real();
}
T norm(const pt &a) { return dot(a, a); }
T distSq(const pt &a, const pt &b) { return norm(b - a); }
T dist(const pt &a, const pt &b) { return abs(b - a); }
T ang(const pt &a, const pt &b) { return arg(b - a); }
T ang(const pt &a, const pt &b, const pt &c) {
  return remainder(ang(b, a) - ang(b, c), 2 * acos(T(-1)));
}
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)); }
pt rot(const pt &a, const pt &p, const T &theta) {
  return (a - p) * pt(polar(T(1), theta)) + p;
}
pt perp(const pt &a) { return pt(-a.imag(), a.real()); }
template <class It>
It sortByAng(It st, It en, const pt &pivot) {
  en = partition(st, en, [&](const pt &p) { return p != pivot; });
  It mid = partition(st, en, [&](const pt &p) {
    return eq(p.imag(), pivot.imag()) ? lt(p.real(), pivot.real())
                                      : lt(p.imag(), pivot.imag());
  });
  auto cmp = [&](const pt &p, const pt &q) { return 0 < ccw(pivot, p, q); };
  sort(st, mid, cmp);
  sort(mid, en, cmp);
  return en;
}
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)); }
  T distSq(const pt &p) const {
    T e = eval(p);
    return e * e / norm(v);
  }
  T dist(const pt &p) const { return abs(eval(p) / abs(v)); }
  Line perpThrough(const pt &p) const { return Line(p, p + perp(v)); }
  Line translate(const pt &p) const { return Line(v, c + cross(v, p)); }
  Line shiftLeft(T d) const { return Line(v, c + d * abs(v)); }
  pt proj(const pt &p) const { return p - perp(v) * eval(p) / norm(v); }
  pt refl(const pt &p) const { return p - perp(v) * T(2) * eval(p) / norm(v); }
};
int lineIntersection(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 mod(int i, int n) { return i < n ? i : i - n; }
int extremeVertex(const Polygon &poly, const pt &dir) {
  int n = poly.size(), lo = 0, hi = n;
  pt pp = perp(dir);
  auto cmp = [&](int i, int j) {
    return sgn(cross(pp, poly[mod(i, n)] - poly[mod(j, n)]));
  };
  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> convexPolygonLineIntersection(const Polygon &poly,
                                             const Line &line) {
  int n = poly.size(), endA = extremeVertex(poly, -perp(line.v));
  int endB = extremeVertex(poly, perp(line.v));
  auto cmpL = [&](int i) { return line.onLeft(poly[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, n) != hi) {
      int m = mod((lo + hi + (lo < hi ? 0 : n)) / 2, n);
      (cmpL(m) == cmpL(endB) ? lo : hi) = m;
    }
    (i ? ret.second : ret.first) = mod(lo + !cmpL(hi), n);
    swap(endA, endB);
  }
  if (ret.first == ret.second) return make_pair(ret.first, -1);
  if (!cmpL(ret.first) && !cmpL(ret.second)) {
    switch ((ret.first - ret.second + n + 1) % n) {
      case 0:
        return make_pair(ret.first, ret.first);
      case 2:
        return make_pair(ret.second, ret.second);
    }
  }
  return ret;
}
const pt O(0, 0);
const T PI = acos(T(-1));
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  int N, Q;
  cin >> N >> Q;
  vector<T> A(N * 4);
  Polygon poly(N);
  for (auto &&p : poly) cin >> p;
  reverse(poly.begin(), poly.end());
  auto getA = [&](int i) { return i < 0 ? T(0) : A[i]; };
  auto area2 = [&](int l, int r) {
    if (l > r) r += N;
    if (l == r) return T(0);
    return getA(r - 1) - getA(l - 1);
  };
  auto getInd = [&](int i) { return i % N; };
  auto getPt = [&](int i) { return poly[getInd(i)]; };
  auto f = [&](pt p, T ang) {
    pt q = p + polar(T(10), ang);
    Line line(p, q);
    int i, j;
    tie(i, j) = convexPolygonLineIntersection(poly, line);
    pt a, b;
    lineIntersection(Line(getPt(i), getPt(i + 1)), line, a);
    lineIntersection(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;
  };
  for (int i = 0; i < N * 4; i++) A[i] = cross(getPt(i), getPt(i + 1));
  partial_sum(A.begin(), A.end(), A.begin());
  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;
}