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;
const double EPS = 1e-9 * 2;
const double INF = 1e30;
const int MAXN = 12345;
const double PI = acos((double)-1);
const int MAXO = 34;
inline bool eq(double a, double b) { return abs(a - b) < EPS; }
inline bool more(double a, double b) { return a >= b + EPS; }
inline bool more_eq(double a, double b) { return a > b - EPS; }
struct Point {
  double x, y;
  Point() {}
  inline Point(double xx, double yy) {
    x = xx;
    y = yy;
  }
};
inline short Sgm(double a) {
  if (a > 0) {
    return 1;
  } else if (a < 0) {
    return -1;
  } else {
    return 0;
  }
}
struct Vector {
  double x, y;
  Vector() {}
  inline Vector(double xx, double yy) {
    x = xx;
    y = yy;
  }
  inline Vector(Point& a, Point& b) {
    x = b.x - a.x;
    y = b.y - a.y;
  }
};
inline double operator*(Vector& a, Vector& b) {
  return (a.x * b.x + a.y * b.y);
}
inline double operator%(Vector& a, Vector& b) {
  return (a.x * b.y - a.y * b.x);
}
inline Vector operator+(Vector a, Vector b) {
  a.x += b.x;
  a.y += b.y;
  return a;
}
inline Point operator+(Point a, Vector b) {
  a.x += b.x;
  a.y += b.y;
  return a;
}
inline Vector rotate_vector(Vector& v, double ang) {
  double cos_ang = cos(ang);
  double sin_ang = sin(ang);
  return Vector(v.x * cos_ang - v.y * sin_ang, v.y * cos_ang + v.x * sin_ang);
}
inline double ang_v(Vector v1, Vector v2) {
  double ang = atan2(v1 % v2, v1 * v2);
  if (eq(ang, 0)) {
    return 0;
  } else if (more(0, ang)) {
    return ang + 2 * PI;
  } else {
    return ang;
  }
}
inline double ang_v2(Vector v1, Vector v2) {
  double ang = atan2(v1 % v2, v1 * v2);
  while (more(ang, PI)) {
    ang -= PI;
  }
  while (more(0, ang)) {
    ang += PI;
  }
  ang = max((double)0, ang);
  ang = min(PI, ang);
  return ang;
}
struct Line {
  Point p1, p2;
  double a, b, c;
  Line() {}
  inline Line(double aa, double bb, double cc) {
    a = aa;
    b = bb;
    c = cc;
    p1 = Point(-a * c, -b * c);
    p2 = Point(p1.x - b, p1.y + a);
  }
  inline Line(Point pp1, Point pp2) {
    p1 = pp1;
    p2 = pp2;
    a = p1.y - p2.y;
    b = p2.x - p1.x;
    c = -a * p1.x - b * p1.y;
  }
};
inline Point get_intersect(Line l1, Line l2) {
  double d = (l1.a * l2.b - l1.b * l2.a);
  if (eq(d, 0)) {
    return Point(INF, INF);
  } else {
    return Point((l1.b * l2.c - l1.c * l2.b) / d,
                 (l1.c * l2.a - l1.a * l2.c) / d);
  }
}
inline double trap(Point a, Point b) { return (b.x - a.x) * (b.y + a.y) / 2; }
inline bool betw(Vector v1, Vector v2, Vector v3) {
  return ((v1 % v2) * (v1 % v3) > 0) && ((v3 % v1) * (v3 % v2) > 0);
}
inline bool leess(Vector v, Vector v1, Vector v2) {
  if (more(v % v1, 0)) {
    if (more(v % v2, 0)) {
      return more(v1 % v2, 0);
    } else {
      return true;
    }
  } else if (more(0, v % v1)) {
    if (more(0, v % v2)) {
      return more(v1 % v2, 0);
    } else {
      return false;
    }
  } else {
    if (more(v * v1, 0)) {
      return true;
    } else {
      return more(0, v % v2);
    }
  }
}
int n, q;
double total_area;
Point mas[MAXN];
double area[MAXN * 3];
inline double get_area(Line l) {
  int l1 = 0;
  int r1 = n;
  while (l1 + 1 < r1) {
    int m1 = (l1 + r1) / 2;
    if (betw(Vector(l.p1, mas[0]), Vector(l.p1, mas[m1]), Vector(l.p1, l.p2))) {
      l1 = m1;
    } else {
      r1 = m1;
    }
  }
  int l2 = 0;
  int r2 = n;
  while (l2 + 1 < r2) {
    int m2 = (l2 + r2) / 2;
    if (leess(Vector(l.p1, mas[0]), Vector(l.p1, mas[m2]),
              Vector(l.p2, l.p1))) {
      l2 = m2;
    } else {
      r2 = m2;
    }
  }
  int p11 = l1;
  Point p12 = get_intersect(Line(mas[l1], mas[r1 % n]), l);
  Point p21 = get_intersect(Line(mas[l2], mas[r2 % n]), l);
  int p22 = r2;
  return (abs((area[n + p11] - area[p22]) + trap(mas[p11], p12) +
              trap(p12, p21) + trap(p21, mas[p22 % n])) -
          (total_area / 2));
}
inline double get_ans() {
  Point p;
  cin >> p.x >> p.y;
  double l1 = 0;
  double r1 = PI;
  double cur_s = get_area(Line(p, mas[0]));
  bool fl;
  Vector v(p, mas[0]);
  if (more(0, cur_s)) {
    fl = false;
  } else if (more(cur_s, 0)) {
    fl = true;
  } else {
    return ang_v2(Vector((double)1, (double)0), rotate_vector(v, 0));
    ;
  }
  double l = 0;
  double r = PI;
  for (int o = 0; o < MAXO; ++o) {
    double m = (l + r) / 2;
    cur_s = get_area(Line(p, p + rotate_vector(v, m)));
    if (eq(cur_s, 0)) {
      return ang_v2(Vector(1, 0), rotate_vector(v, m));
    } else if (fl ^ more(0, cur_s)) {
      l = m;
    } else {
      r = m;
    }
  }
  return ang_v2(Vector((double)1, (double)0), rotate_vector(v, l));
}
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  cin >> n >> q;
  for (int i = 0; i < n; ++i) {
    cin >> mas[i].x >> mas[i].y;
  }
  reverse(mas, mas + n);
  area[0] = 0;
  for (int i = 1; i < 3 * n; ++i) {
    area[i] = area[i - 1] + (mas[i % n].x - mas[(i - 1) % n].x) *
                                (mas[i % n].y + mas[(i - 1) % n].y) / 2;
  }
  total_area = abs(area[n]);
  cout.precision(15);
  for (int i = 0; i < q; ++i) {
    cout << get_ans() << '\n';
  }
  cout << endl;
  return 0;
}