#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); }
};
inline DO sgn(DO a) { return (a > eps) - (a < -eps); }
point p[NN << 2], dir, org;
DO zone[NN << 2];
int n;
inline point inter(point a, point b, point c, point d) {
  return a + (b - a) * ((d - c ^ c - a) / (d - c ^ b - a));
}
inline int calc(DO d) {
  int nega, real, lft, rgt;
  int st, ed, md;
  dir = point(cos(d), sin(d));
  do {
    nega = rand() % n;
  } while (sgn(dir ^ p[nega] - org) >= 0);
  do {
    real = rand() % n;
  } while (sgn(dir ^ p[real] - org) <= 0);
  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;
  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 = 40; 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;
}
