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;
using DO = double;
const DO pi = acosl(-1);
const DO eps = 1e-10;
const int NN = 10010;
struct point {
  DO x, y;
  point(DO x = 0, DO y = 0) : x(x), y(y) {}
  point operator+(point a) { return point(x + a.x, y + a.y); }
  point operator-(point a) { return point(x - a.x, y - a.y); }
  point operator*(DO a) { return point(x * a, y * a); }
  point operator/(DO a) { return point(x / a, y / a); }
  DO operator^(point a) { return x * a.y - y * a.x; }
  void scanp() { scanf("%lf %lf", &x, &y); }
  void printp() { printf("%lf %lf\n", x, y); }
};
DO sgn(DO a) { return (a > eps) - (a < -eps); }
point p[NN << 2], dir, org;
DO zone[NN << 2];
int n;
point inter(point a, point b, point c, point d) {
  return a + (b - a) * ((d - c ^ c - a) / (d - c ^ b - a));
}
int calc(DO d) {
  int nega, real, lft, rgt;
  int st, ed, md;
  dir = point(cos(d), sin(d));
  if (sgn(dir ^ p[0] - org))
    real = 0;
  else
    real = 1;
  lft = sgn(dir ^ p[real] - org);
  st = real, ed = st + n;
  while (true) {
    md = st + ed >> 1;
    rgt = sgn(dir ^ p[md] - org);
    if (rgt + lft == 0) break;
    if (sgn(org - p[real] ^ p[md] - p[real]) > 0)
      ed = md;
    else
      st = md;
  }
  nega = md;
  if (sgn(dir ^ p[nega] - org) != -1) swap(nega, real);
  if (nega < real) nega += n;
  st = real, ed = nega;
  while (ed - st > 1) {
    md = st + ed >> 1;
    if (sgn(dir ^ (p[md] - org)) <= 0)
      ed = md;
    else
      st = md;
  }
  lft = ed;
  real += n;
  st = nega, ed = real;
  while (ed - st > 1) {
    md = st + ed >> 1;
    if (sgn(dir ^ (p[md] - org)) <= 0)
      st = md;
    else
      ed = md;
  }
  rgt = st;
  point a, b;
  if (sgn(dir ^ (p[lft] - org)) == 0)
    a = p[lft];
  else
    a = inter(p[lft == 0 ? n - 1 : lft - 1], p[lft], org, org + dir);
  if (sgn(dir ^ (p[rgt] - org)) == 0)
    b = p[rgt];
  else
    b = inter(p[rgt], p[rgt + 1], org, org + dir);
  DO s = zone[rgt] - zone[lft] + (p[rgt] ^ p[lft]) + fabs(p[rgt] - a ^ b - a) +
         fabs(p[lft] - a ^ p[rgt] - a);
  return sgn(zone[n] - s * 2);
}
int main() {
  int test;
  srand(time(0));
  scanf("%d %d", &n, &test);
  for (int i = n - 1; i >= 0; --i) {
    p[i].scanp();
    p[i + n] = p[i + n + n] = p[i + n + n + n] = p[i];
  }
  for (int i = 1; i < (n << 2); ++i) {
    zone[i] = zone[i - 1] + (p[i - 1] ^ p[i]);
  }
  DO st, ed, md;
  int ST, ED, MD;
  while (test--) {
    org.scanp();
    st = 0;
    ed = pi;
    ST = calc(st);
    ED = calc(ed);
    if (ST == 0 || ED == 0) {
      printf("%.9lf\n", st);
      continue;
    }
    for (int loop = 60; loop--;) {
      md = (st + ed) / 2;
      MD = calc(md);
      if (MD == 0) break;
      if (ST == MD)
        st = md;
      else
        ed = md;
    }
    if (MD) md = (st + ed) / 2;
    printf("%.10lf\n", md);
  }
  return 0;
}