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>
#pragma GCC optimize(3)
#pragma GCC optimize("fast-math")
using namespace std;
struct InputReader {
  char buf[1048576];
  int p;
  inline InputReader() { p = 1048576; }
  inline void Flush() {
    p = 0;
    fread(buf, 1, 1048576, stdin);
  }
  inline char C() {
    if (p >= 1048576) Flush();
    return buf[p++];
  }
  inline char Readnum() {
    char ch = C();
    while (!isdigit(ch) && ch != '-') ch = C();
    return ch;
  }
  inline void Readalpha(char &c) {
    c = C();
    while (!isalpha(c)) c = C();
  }
  int operator()() {
    int ans = 0, fu = 1;
    char ch = Readnum();
    if (ch == '-') fu = -1, ch = C();
    while (ch >= '0' && ch <= '9') {
      ans = ans * 10 + ch - '0';
      ch = C();
    }
    return ans * fu;
  }
  long long Readll() {
    long long ans = 0LL, fu = 1LL;
    char ch = Readnum();
    if (ch == '-') fu = -1LL, ch = C();
    while (ch >= '0' && ch <= '9') {
      ans = ans * 10LL + ch - '0';
      ch = C();
    }
    return ans * fu;
  }
  inline void Readstring(string &x) {
    x.clear();
    char ch = C();
    while (!isdigit(ch) && !isalpha(ch) && ch != '#' && ch != '.') ch = C();
    while (isdigit(ch) || isalpha(ch) || ch == '#' || ch == '.') {
      x += ch;
      ch = C();
    }
  }
  inline void Readchstring(char s[]) {
    int len = 0;
    char ch = C();
    while (!isdigit(ch) && !isalpha(ch)) ch = C();
    while (isdigit(ch) || isalpha(ch)) {
      s[len++] = ch;
      ch = C();
    }
    s[len] = '\0';
  }
  inline void Specialread(char &c) {
    c = C();
    while (!isdigit(c) && !isalpha(c) && c != '#' && c != '.' && c != '=' &&
           c != 'B')
      c = C();
  }
} In;
inline void Read(int &x) { x = In(); }
inline void Read(int &x, int &y) {
  x = In();
  y = In();
}
inline void Read(int &x1, int &x2, int &x3) {
  x1 = In();
  x2 = In();
  x3 = In();
}
inline void Read(int &x1, int &x2, int &x3, int &x4) {
  x1 = In();
  x2 = In();
  x3 = In();
  x4 = In();
}
inline void Read(long long &x) { x = In.Readll(); }
inline void Read(long long &x, long long &y) {
  x = In.Readll();
  y = In.Readll();
}
inline void Read(long long &x1, long long &x2, long long &x3) {
  x1 = In.Readll();
  x2 = In.Readll();
  x3 = In.Readll();
}
inline void Read(long long &x1, long long &x2, long long &x3, long long &x4) {
  x1 = In.Readll();
  x2 = In.Readll();
  x3 = In.Readll();
  x4 = In.Readll();
}
template <typename T>
void Read(T a[], int st, int ed) {
  for (int(i) = (st); (i) <= (ed); ++(i)) Read(a[i]);
}
inline void FILEIO() {}
inline void FILEIO(string pname) {
  freopen((pname + ".in").c_str(), "r", stdin);
  freopen((pname + ".out").c_str(), "w", stdout);
}
inline void FILEIO_OICONTEST(string pname) {
  freopen((pname + ".in").c_str(), "r", stdin);
  freopen((pname + ".out").c_str(), "w", stdout);
}
void Printtime() {}
void END() {
  Printtime();
  exit(0);
}
template <typename T>
void END(T mes) {
  cout << mes << endl;
  END();
}
template <typename T>
void Print(T a[], int s, int t, char sp = ' ', char ed = '\n') {
  if (s > t) return;
  for (int i = s; i < t; i++) cout << a[i] << sp;
  cout << a[t] << ed;
  cout.flush();
}
template <typename T>
void Print(T a, int s = 0, int t = -1, char sp = ' ', char ed = '\n') {
  if (t == -1) t = a.size() - 1;
  for (int i = s; i <= t; i++) cout << a[i] << sp;
  cout << ed;
  cout.flush();
}
vector<int> Range(int l, int r) {
  vector<int> ret{};
  for (int(i) = (l); (i) <= (r); ++(i)) ret.push_back(i);
  return ret;
}
mt19937 Rand(0xe38195e38293);
constexpr long double Eps = 1e-7;
constexpr long double PI = 3.14159265358979323846264338327950288419716939937510;
const int MAXN = 10010;
const int LOG = 16;
struct Point {
  long double x, y;
  inline long double Len() const { return sqrt(((x) * (x)) + ((y) * (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 long double operator^(const Point &a, const Point &b) {
  return a.x * b.x + a.y * b.y;
}
inline long double operator*(const Point &a, const Point &b) {
  return a.x * b.y - a.y * b.x;
}
inline Point operator*(const Point &a, const long double &b) {
  return {a.x * b, a.y * b};
}
inline Point operator/(const Point &a, const long double &b) {
  return {a.x / b, a.y / b};
}
inline long double Dis(const Point &a, const Point &b) {
  return sqrt(((a.x - b.x) * (a.x - b.x)) + ((a.y - b.y) * (a.y - b.y)));
}
inline long double Dis2(const Point &a, const Point &b) {
  return ((a.x - b.x) * (a.x - b.x)) + ((a.y - b.y) * (a.y - b.y));
}
ostream &operator<<(ostream &out, const Point &p) {
  out << p.x << " " << p.y << "  ";
  return out;
}
inline bool TurnLeft(const Point &a, const Point &b, const Point &c) {
  return (b - a) * (c - b) > Eps;
}
inline bool TurnRight(const Point &a, const Point &b, const Point &c) {
  return (b - a) * (c - b) < -Eps;
}
inline bool OnLine(const Point &p, const Point &a1, const Point &a2) {
  return (fabs(((p - a1) * (a2 - p)) - (0)) <= Eps) and
         ((p - a1) ^ (a2 - p)) > -Eps;
}
inline bool Intersect(const Point &a, const Point &b, const Point &c,
                      const Point &d) {
  if (OnLine(a, c, d) or OnLine(b, c, d)) return 1;
  return (TurnRight(c, a, d) ^ TurnRight(c, b, d)) and
         (TurnRight(a, c, b) ^ TurnRight(a, d, b));
}
inline Point InsPoint(const Point &p1, const Point &p2, const Point &p3,
                      const Point &p4) {
  const long double dis = Dis(p1, p2);
  long double d1 = fabs((p2 - p3) * (p3 - p1)) / dis;
  long double d2 = fabs((p2 - p4) * (p4 - p1)) / dis;
  long double ratio = d1 / (d1 + d2);
  return (p4 - p3) * ratio + p3;
}
int n, q;
Point a[MAXN], o;
long double a_area;
long double cross_psum[MAXN];
inline int Next(const int &x) { return x == n ? 1 : x + 1; }
long double PolyArea(Point a[], int n) {
  long double ans = 0;
  for (int(i) = (2); (i) <= (n - 1); ++(i))
    ans += (a[i] - a[1]) * (a[i + 1] - a[1]);
  return fabs(ans) / 2;
}
int Crossed(const Point &d) {
  if (Intersect(a[1], a[n], o, d)) return n;
  const long double odlen = (d - o).Len();
  const Point od_div_odlen = (d - o) / odlen;
  auto GetPolarAngle = [=](const Point &p) {
    const Point od = d - o, op = p - o;
    long double h = fabs(od_div_odlen * op);
    long double theta = h / op.Len();
    if ((od ^ op) > 0) {
      if (od * op > 0)
        return theta;
      else
        return PI + PI - theta;
    } else {
      if (od * op > 0)
        return PI - theta;
      else
        return theta + PI;
    }
  };
  long double init_polar_angle = GetPolarAngle(a[1]);
  int ans = 1;
  for (int(i) = (LOG)-1; (i) >= 0; --(i)) {
    int v = ans + (1 << i);
    if (v >= n) continue;
    if (GetPolarAngle(a[v]) > init_polar_angle) ans = v;
  }
  if (ans != 1 and Intersect(a[ans - 1], a[ans], o, d)) --ans;
  return ans;
}
long double first(long double alpha) {
  const long double sinres = sin(alpha), cosres = cos(alpha);
  const long double MULT = 1e9;
  Point d = o + Point{cosres * MULT, sinres * MULT};
  Point nd = o - Point{cosres * MULT, sinres * MULT};
  int ans_mult = 1;
  if (TurnLeft(nd, a[1], d)) {
    swap(d, nd);
    ans_mult = -1;
  }
  int l = Crossed(nd);
  int r = Crossed(d);
  Point lins = InsPoint(a[l], a[Next(l)], o, nd);
  Point rins = InsPoint(a[r], a[Next(r)], o, d);
  r = Next(r);
  long double area1 = cross_psum[l] +
                      (r == 1 ? 0 : cross_psum[n] - cross_psum[r]) +
                      fabs((a[l] - a[1]) * (a[r] - a[1])) / 2;
  area1 += fabs((rins - lins) * (a[l] - lins)) / 2;
  area1 += fabs((a[r] - a[l]) * (rins - a[l])) / 2;
  long double area2 = a_area - area1;
  return (area1 - area2) * ans_mult;
}
long double Solve() {
  const long double allow_abs_delta = (5e-5) * a_area;
  long double l = 0, r = PI, l_fres = first(l), r_fres = first(r);
  long double ans = -1, min_abs_delta = ((long long)(0x3f3f3f3f3f3f3f3f));
  if (fabs(l_fres) < allow_abs_delta) return l;
  if (fabs(r_fres) < allow_abs_delta) return r;
  for (int(_t) = 1; (_t) <= (50); ++(_t)) {
    long double mid = (l + r) / 2;
    long double mid_fres = first(mid);
    if (fabs(mid_fres) < min_abs_delta) {
      min_abs_delta = fabs(mid_fres);
      ans = mid;
    }
    if (min_abs_delta <= allow_abs_delta) break;
    if ((mid_fres > 0) == (l_fres > 0))
      l = mid + Eps;
    else
      r = mid - Eps;
  }
  return ans;
}
int main() {
  FILEIO();
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  cin >> n >> q;
  for (int(i) = 1; (i) <= (n); ++(i)) cin >> a[i].x >> a[i].y;
  reverse(a + 1, a + 1 + n);
  a_area = PolyArea(a, n);
  for (int(i) = (3); (i) <= (n); ++(i)) {
    cross_psum[i] =
        cross_psum[i - 1] + fabs((a[i] - a[1]) * (a[i - 1] - a[1])) / 2;
  }
  for (int(qi) = 1; (qi) <= (q); ++(qi)) {
    cin >> o.x >> o.y;
    long double ans = Solve();
    cout << setprecision(16) << fixed << ans << endl;
  }
  END();
}