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 <typename T, typename U>
inline void smin(T &a, U b) {
  if (a > b) a = b;
}
template <typename T, typename U>
inline void smax(T &a, U b) {
  if (a < b) a = b;
}
struct point {
  double first, second;
  point(double first = 0, double second = 0) : first(first), second(second) {}
  point operator-(point a) { return point(first - a.first, second - a.second); }
  point operator+(point a) { return point(first + a.first, second + a.second); }
  point operator/(double a) { return point(first / a, second / a); }
  point operator*(double a) { return point(first * a, second * a); }
  double operator*(point a) { return first * a.first + second * a.second; }
  double operator^(point a) { return first * a.second - second * a.first; }
  void input() { scanf("%lf%lf", &first, &second); }
  double al() { return atan2(second, first); }
};
point p[100010], O;
double area[100010];
const double pi = acos(-1);
double a, b, c;
int calc(int st, int ed, int ok = 0) {
  while (st < ed) {
    int ii = (st + ed + 1 - ok) >> 1;
    double ui = a * p[ii].first + b * p[ii].second + c;
    if (!ok)
      if (ui > 0)
        st = ii;
      else
        ed = ii - 1;
    else if (ui < 0)
      st = ii + 1;
    else
      ed = ii;
  }
  return st;
}
point intersect(point A, point B) {
  return A + (B - A) * (-(c + point(a, b) * A) / (point(a, b) * (B - A)));
}
int main() {
  int n, Q;
  scanf("%d%d", &n, &Q);
  for (int i = 0; i < n; i++) p[n - i - 1].input();
  for (int i = 0; i < n * 3; i++) p[i + n] = p[i];
  for (int i = 1; i < n * 4; i++) area[i] = area[i - 1] + (p[i - 1] ^ p[i]);
  double tot_area = area[n];
  while (Q--) {
    O.input();
    double st = 0, ed = pi, u0, u1, al, zero, ans;
    int found = false;
    for (int i = 0; i < 60; i++) {
      if (i == 0)
        al = st;
      else
        al = (st + ed) / 2;
      a = sin(al), b = -cos(al), c = -(a * O.first + b * O.second);
      u0 = a * p[0].first + b * p[0].second + c;
      u1 = a * p[1].first + b * p[1].second + c;
      bool flag = false;
      if (u0 > u1) {
        u0 = -u0, u1 = -u1;
        a = -a, b = -b, c = -c;
        flag = true;
      }
      int lft = 0, rgt = n - 1;
      while (lft < rgt) {
        int ii = lft + rgt + 1 >> 1;
        int jj = ii + 1;
        double ui = a * p[ii].first + b * p[ii].second + c;
        double uj = a * p[jj].first + b * p[jj].second + c;
        if (ui <= uj && ui >= (u0 + u1) * 0.5)
          lft = ii;
        else
          rgt = ii - 1;
      }
      int id_max = lft + 1;
      lft = id_max + 1, rgt = id_max + n - 1;
      while (lft < rgt) {
        int ii = lft + rgt >> 1;
        int jj = ii + 1;
        double ui = a * p[ii].first + b * p[ii].second + c;
        double uj = a * p[jj].first + b * p[jj].second + c;
        if (ui > uj)
          lft = ii + 1;
        else
          rgt = ii;
      }
      int id_min = lft;
      int eed = calc(id_max, id_min, 0) + n;
      int sst = calc(id_min, id_max + n, 1);
      point ped = intersect(p[eed % n], p[(eed + 1) % n]);
      point pst = intersect(p[(sst + n - 1) % n], p[sst % n]);
      double mid_area = 0;
      mid_area += pst ^ p[sst];
      mid_area += area[eed] - area[sst];
      mid_area += p[eed] ^ ped;
      mid_area += ped ^ pst;
      if (flag) mid_area = tot_area - mid_area;
      if (fabs(mid_area * 2 - tot_area) < 1e-8) {
        found = true;
        ans = al;
        break;
      }
      if (i == 0) {
        zero = mid_area;
        continue;
      }
      if ((mid_area > tot_area * 0.5) == (zero > tot_area * 0.5))
        st = al;
      else
        ed = al;
    }
    printf("%.18lf\n", found ? ans : al);
  }
  return 0;
}