#include <bits/stdc++.h>
using namespace std;
const long double pi = acosl(-1);
const int maxn = 200010;
const long long mod = 1e9 + 7;
const long long inf = 1e18;
const long double eps = 1e-6;
const long double EPS = eps;
int T, n;
bool eq(long double a, long double b) { return abs(a - b) < EPS; }
int dcmp(long double x) {
  if (fabs(x) < eps)
    return 0;
  else
    return x < 0 ? -1 : 1;
}
struct Pt {
  long double x, y;
  Pt() {}
  Pt(long double x, long double y) : x(x), y(y) {}
  Pt(const Pt &p) : x(p.x), y(p.y) {}
  Pt operator+(const Pt &p) const { return {x + p.x, y + p.y}; }
  Pt operator-(const Pt &p) const { return {x - p.x, y - p.y}; }
  Pt operator*(const long double c) const { return {x * c, y * c}; }
  Pt operator/(const long double c) const { return {x / c, y / c}; }
  bool operator==(const Pt &p) const { return eq(x, p.x) && eq(y, p.y); }
  bool operator!=(const Pt &p) const { return !(*this == p); }
  bool operator<(const Pt &p) const {
    return eq(x, p.x) ? y < p.y - EPS : x < p.x;
  }
  Pt rot() { return {-y, x}; }
  long double abs() const { return hypotl(x, y); }
};
long double dot(Pt p, Pt q) { return p.x * q.x + p.y * q.y; }
long double cross(Pt p, Pt q) { return p.x * q.y - p.y * q.x; }
long double dist2(Pt p, Pt q) { return dot(p - q, p - q); }
long double dist(Pt p, Pt q) { return sqrt(dist2(p, q)); }
long double length(Pt a) { return sqrt(dot(a, a)); }
long double angle(Pt a, Pt b) {
  return acos(dot(a, b) / length(a) / length(b));
}
long double angle_aob(Pt a, Pt o, Pt b) {
  Pt oa = a - o, ob = b - o;
  return angle(oa, ob);
}
Pt rotate(Pt a, long double rad) {
  return Pt(a.x * cos(rad) - a.y * sin(rad), a.x * sin(rad) + a.y * cos(rad));
}
Pt normal(Pt a) {
  long double l = length(a);
  return Pt(-a.y / l, a.x / l);
}
int ccw(Pt p, Pt q, Pt r) {
  long double v = cross(p - q, p - r);
  if (v < -EPS) return -1;
  if (v > EPS) return 1;
  return 0;
}
pair<int, int> linePolygonIntersection(const Pt &pt, double ang, Pt *a, int n) {
  int rev = 0;
  if (cross(a[0] - pt, Pt(cos(ang), sin(ang))) < 0) {
    rev = 1;
    ang -= pi;
  }
  Pt unit(cos(ang), sin(ang));
  int l = 0, r = n - 1, s1, s2;
  while (l <= r) {
    int mid = (l + r) / 2;
    if (cross(unit, a[mid] - pt) > 0)
      r = mid - 1;
    else {
      if (cross(a[mid] - pt, a[0] - pt) <= 0) {
        l = mid + 1;
        s1 = mid;
      } else
        r = mid - 1;
    }
  }
  r = n - 1;
  unit.x = -unit.x;
  unit.y = -unit.y;
  while (l <= r) {
    int mid = (l + r) / 2;
    if (cross(unit, a[mid] - pt) < 0) {
      l = mid + 1;
      s2 = mid;
    } else
      r = mid - 1;
  }
  if (rev) swap(s1, s2);
  return {s1, s2};
}
int q, x, y;
double pre[maxn];
Pt a[maxn];
void init() {
  for (int i = 1; i < n; i++) {
    pre[i] = pre[i - 1] + cross(a[i - 1], a[i]);
  }
  pre[n] = pre[n - 1] + cross(a[n - 1], a[0]);
}
Pt lineIntersection(Pt p, Pt v, Pt q, Pt w) {
  Pt u = p - q;
  long double t = cross(w, u) / cross(v, w);
  return p + v * t;
}
double sol(const Pt &pt, double ang) {
  double tot = pre[n];
  auto pa = linePolygonIntersection(pt, ang, a, n);
  Pt A = pt, B = Pt(pt.x + cos(ang), pt.y + sin(ang));
  Pt s1 = lineIntersection(a[pa.first], a[(pa.first + 1) % n] - a[pa.first], A,
                           B - A);
  Pt s2 = lineIntersection(a[pa.second], a[(pa.second + 1) % n] - a[pa.second],
                           A, B - A);
  pa.first = (pa.first + 1) % n;
  double area =
      cross(s1, a[pa.first]) + cross(a[pa.second], s2) + cross(s2, s1);
  if (pa.first <= pa.second)
    area += pre[pa.second] - pre[pa.first];
  else
    area += tot - pre[pa.first] + pre[pa.second];
  return area - (tot - area);
}
int main() {
  scanf("%d%d", &n, &q);
  for (int i = 0; i < n; i++) {
    scanf("%d%d", &x, &y);
    a[i] = Pt(x, y);
  }
  reverse(a, a + n);
  init();
  Pt pt;
  for (int i = 0; i < q; i++) {
    scanf("%d%d", &x, &y);
    pt.x = x;
    pt.y = y;
    double l = 0, r = pi, mid = -1;
    double al = sol(pt, l);
    for (int it = 0; it < 50; it++) {
      mid = (l + r) / 2;
      double tmp = sol(pt, mid);
      if (tmp * al <= 0)
        r = mid;
      else
        l = mid, al = tmp;
    }
    printf("%.10lf\n", mid);
  }
}
