#include <bits/stdc++.h>
using namespace std;
const double PI = acos(-1);
const int MX = 10005;
struct Point {
  double x, y;
} pts[2 * MX];
Point operator-(Point a, Point b) {
  a.x -= b.x;
  a.y -= b.y;
  return a;
}
Point operator+(Point a, Point b) {
  a.x += b.x;
  a.y += b.y;
  return a;
}
Point operator*(Point a, double k) {
  a.x *= k;
  a.y *= k;
  return a;
}
double cp(Point a, Point b) { return a.x * b.y - a.y * b.x; }
Point intersection(Point p, Point v, Point q, Point u) {
  double T = (cp(p, v) - cp(q, v)) / cp(u, v);
  return q + u * T;
}
double S[2 * MX];
int n;
double calc(Point pivot, double alpha) {
  Point v = {cos(alpha), sin(alpha)};
  auto getDist = [&](Point p) { return cp(v, p - pivot); };
  int lo = 0, hi = 0;
  {
    int L = 0, R = n - 2;
    while (L <= R) {
      int M = (L + R) / 2;
      bool ok;
      if (getDist(pts[0]) > getDist(pts[n - 1])) {
        ok = getDist(pts[M + 1]) <= getDist(pts[M]) ||
             getDist(pts[M + 1]) > getDist(pts[0]);
      } else {
        ok = getDist(pts[M + 1]) <= getDist(pts[M]) &&
             getDist(pts[M + 1]) <= getDist(pts[0]);
      }
      if (ok) {
        lo = M + 1;
        L = M + 1;
      } else {
        R = M - 1;
      }
    }
  }
  {
    int L = 0, R = n - 2;
    while (L <= R) {
      int M = (L + R) / 2;
      bool ok;
      if (getDist(pts[0]) < getDist(pts[n - 1])) {
        ok = getDist(pts[M + 1]) >= getDist(pts[M]) ||
             getDist(pts[M + 1]) < getDist(pts[0]);
      } else {
        ok = getDist(pts[M + 1]) >= getDist(pts[M]) &&
             getDist(pts[M + 1]) >= getDist(pts[0]);
      }
      if (ok) {
        hi = M + 1;
        L = M + 1;
      } else {
        R = M - 1;
      }
    }
  }
  int a = 0, b = 0;
  {
    int L = lo, R = hi;
    if (R <= L) R += n;
    R--;
    while (L <= R) {
      int M = (L + R) / 2;
      if (getDist(pts[M]) < 0) {
        a = M;
        L = M + 1;
      } else {
        R = M - 1;
      }
    }
  }
  {
    int L = hi, R = lo;
    if (R <= L) R += n;
    R--;
    while (L <= R) {
      int M = (L + R) / 2;
      if (getDist(pts[M]) > 0) {
        b = M;
        L = M + 1;
      } else {
        R = M - 1;
      }
    }
  }
  if (a >= n) a -= n;
  if (b >= n) b -= n;
  if (a > b) b += n;
  Point p1 = intersection(pivot, v, pts[a], pts[a + 1] - pts[a]);
  Point p2 = intersection(pivot, v, pts[b], pts[b + 1] - pts[b]);
  return S[b] - S[a + 1] + cp(pts[a + 1], p1) + cp(p1, p2) + cp(p2, pts[b]);
}
int main() {
  int q;
  ignore = scanf("%d %d", &n, &q);
  for (int i = 0; i < n; i++) {
    ignore = scanf("%lf %lf", &pts[i].x, &pts[i].y);
  }
  reverse(pts, pts + n);
  for (int i = 0; i < n; i++) {
    pts[i + n] = pts[i];
  }
  for (int i = 1; i < 2 * n; i++) {
    S[i] = S[i - 1] + cp(pts[i], pts[i - 1]);
  }
  double total = S[n];
  while (q--) {
    Point p;
    ignore = scanf("%lf %lf", &p.x, &p.y);
    double L = 0, R = PI;
    bool sgn = (2.0 * calc(p, 0) - total) >= 0.0;
    for (int rep = 0; rep < 50; rep++) {
      double M = (L + R) / 2;
      double tmp = 2.0 * calc(p, M) - total;
      if ((tmp >= 0) == sgn) {
        L = M;
      } else {
        R = M;
      }
    }
    printf("%.15lf\n", (L + R) / 2);
  }
}
