func_code_string: #include <bits/stdc++.h>   using namespace std;   const int INF = 1.01e9;   const double PI = acos(-1);   bool eq(double A, double B) { return abs(A - B) < 1e-9; }   bool ls(double A, double B) { return A < B && !eq(A, B); }   bool le(double A, double B) { return A < B || eq(A, B); }   struct pt {     double x, y, id;     pt() {}     pt(double xx, double yy) : x(xx), y(yy) {}     pt operator+(pt A) { return pt(x + A.x, y + A.y); }     pt operator-(pt A) { return pt(x - A.x, y - A.y); }     pt operator*(double k) { return pt(x * k, y * k); }     pt operator/(double k) {       assert(abs(k) > 1e-20);       return pt(x / k, y / k);     }     double operator*(pt A) { return x * A.y - y * A.x; }     double operator%(pt A) { return x * A.x + y * A.y; }     bool operator==(pt A) { return eq(x, A.x) && eq(y, A.y); }     bool operator!=(pt A) { return !eq(x, A.x) || !eq(y, A.y); }     double len() { return sqrt(x * x + y * y); }     double len2() { return x * x + y * y; }     pt rotate() { return pt(-y, x); }     pt norm() { return (*this) / len(); }     bool operator<(pt A) { return x < A.x || (eq(x, A.x) && ls(y, A.y)); }     void read() { scanf( %lf%lf , &x, &y); }     void Epr() { cerr <<  x y:   << x <<     << y << endl; }   };   struct Line {     pt O, v;     Line(pt A, pt B) : O(A), v((B - A).norm()) {}     pt operator*(Line l) {       pt u = l.v.rotate();       double t = (l.O - O) % u / (v % u);       return O + v * t;     }   };   int main() {     int n, q;     scanf( %d%d , &n, &q);     vector<pt> p(n);     for (int i = 0; i < n; i++) {       p[i].read();     }     reverse((p).begin(), p.end());     int idMn = 0;     int idMx = 0;     for (int i = 0; i < n; i++) {       if (p[i] < p[idMn]) {         idMn = i;       }       if (p[idMx] < p[i]) {         idMx = i;       }     }     vector<double> tr(n);     vector<double> prefArea(n + 1);     auto getTrap = [&](pt A, pt B) { return (A.x - B.x) * (A.y + B.y) / 2; };     for (int i = 0; i < n; i++) {       tr[i] = getTrap(p[i], p[(i + 1) % n]);       prefArea[i + 1] = prefArea[i] + tr[i];     }     for (int i = 0; i < n; i++) p[i].id = i;     vector<pt> part[2];     for (int tt = 0; tt < 2; tt++) {       for (int i = idMn; i != idMx; i = (i + 1) % n) {         part[tt].push_back(p[i]);       }       part[tt].push_back(p[idMx]);       swap(idMn, idMx);     }     auto getFarPoint = [&](pt v) {       int where = 0;       int tt;       if (v.y < 0) {         tt = 0;       } else {         tt = 1;       }       int l = 0;       int r = part[tt].size() - 1;       while (r - l > 3) {         int m1 = (l + l + r) / 3;         int m2 = (l + r + r) / 3;         if (part[tt][m1] % v > part[tt][m2] % v) {           r = m2;         } else {           l = m1;         }       }       for (int i = l; i <= r; i++) {         if (part[tt][i] % v > p[where] % v) {           where = part[tt][i].id;         }       }       return where;     };     auto getSegArea = [&](int l, int r) {       l %= n;       r %= n;       if (l <= r) {         return prefArea[r] - prefArea[l];       }       return prefArea[n] - prefArea[l] + prefArea[r];     };     auto getArea = [&](pt O, double ang) {       pt v(cos(ang), sin(ang));       pt u = v.rotate();       int p1 = getFarPoint(u);       int p2 = getFarPoint(u * -1);       int ret[2];       for (int tt = 0; tt < 2; tt++) {         int l = p2;         int r = p1;         assert(l != r);         if (r < l) {           r += n;         }         while (r - l > 1) {           if ((p[(l + r) / 2 % n] - O) * v > 0) {             l = (l + r) / 2;           } else {             r = (l + r) / 2;           }         }         ret[tt] = l;         v = v * -1;         swap(p1, p2);       }       pt G1 = Line(p[ret[0] % n], p[(ret[0] + 1) % n]) * Line(O, O + v);       pt G2 = Line(p[ret[1] % n], p[(ret[1] + 1) % n]) * Line(O, O + v);       double res = 0;       res += getSegArea((ret[0] + 1) % n, ret[1]);       res += getTrap(p[ret[1] % n], G2);       res += getTrap(G2, G1);       res += getTrap(G1, p[(ret[0] + 1) % n]);       return res;     };     for (int tt = 0; tt < q; tt++) {       pt O;       O.read();       double l, r;       double res = getArea(O, 0);       if (res * 2 < prefArea.back()) {         l = 0;         r = PI;       } else {         l = PI;         r = PI * 2;       }       for (int it = 0; it < 40; it++) {         double tmp = getArea(O, (l + r) / 2);         if (tmp * 2 < prefArea.back()) {           l = (l + r) / 2;         } else {           r = (l + r) / 2;         }       }       double ang = (l + r) / 2;       if (ang > PI) {         ang -= PI;       }       printf( %.17f n , ang);     }     return 0;   }   