func_code_string: #include <bits/stdc++.h>   using namespace std;   struct Vec {     double x, y;     Vec(double newX = 0, double newY = 0) {       x = newX;       y = newY;     }     Vec operator+(Vec r) { return Vec(x + r.x, y + r.y); }     Vec operator-(Vec r) { return Vec(x - r.x, y - r.y); }     Vec operator*(double r) { return Vec(x * r, y * r); }     Vec operator/(double r) { return Vec(x / r, y / r); }     double operator*(Vec r) { return x * r.x + y * r.y; }     Vec normal() { return Vec(y, -x); }     double len() { return sqrt(x * x + y * y); }   };   double cprod(Vec l, Vec r) { return l.x * r.y - l.y * r.x; }   Vec intersection(Vec first1, Vec first2, Vec second1, Vec second2) {     Vec n1 = (first2 - first1).normal();     Vec n2 = (second2 - second1).normal();     double c1 = first1 * n1;     double c2 = second1 * n2;     double x = c1 * n2.y - c2 * n1.y;     double y = c2 * n1.x - c1 * n2.x;     double div = n1.x * n2.y - n1.y * n2.x;     return Vec(x, y) / div;   }   double getArea(vector<Vec> pts) {     double result = 0;     for (size_t i = 0; i < pts.size(); i++)       result += cprod(pts[i], pts[(i + 1) % pts.size()] - pts[i]) / 2;     return abs(result);   }   int n, r;   double pi = acos(-1);   Vec getPt(int ind) {     ind = (ind % n + n) % n;     return Vec(r * sin(2 * pi * ind / n), r * cos(2 * pi * ind / n));   }   int main() {     double area = 0;     cin >> n >> r;     {       vector<Vec> pts = {           getPt(0), getPt(n / 2),           intersection(getPt(n / 2), getPt(-1), getPt(n / 2 + 1), getPt(1)),           getPt(n / 2 + 1)};       area += getArea(pts);     }     int segments = 2, cursize = (n - 3) / 2;     while (cursize > 0) {       Vec mid;       if (cursize + 1 != n / 2)         mid = intersection(getPt(0), getPt(n / 2), getPt(cursize + 1),                            getPt(cursize + 1 - n / 2));       else         mid = getPt(0) + (getPt(n / 2) - getPt(0)) / 2;       if (cursize % 2) {         Vec top = getPt((cursize + 1) / 2);         Vec lopp = getPt((cursize + 1) / 2 - n / 2);         Vec ropp = getPt((cursize + 1) / 2 + n / 2);         vector<Vec> pts = {top, intersection(top, lopp, getPt(0), getPt(n / 2)),                            mid,                            intersection(top, ropp, getPt(cursize + 1),                                         getPt(cursize + 1 - n / 2))};         area += segments * getArea(pts);         cursize = (cursize - 1) / 2;       } else {         Vec top1 = getPt((cursize + 1) / 2);         Vec top2 = getPt((cursize + 1) / 2 + 1);         Vec bot1 = getPt((cursize + 1) / 2 + n / 2);         Vec bot2 = getPt((cursize + 1) / 2 - n / 2);         Vec bot3 = getPt((cursize + 1) / 2 + 1 - n / 2);         vector<Vec> pts = {             top1,             intersection(top1, bot2, getPt(0), getPt(n / 2)),             mid,             intersection(top2, bot2, getPt(cursize + 1), getPt(cursize + 1 - n / 2)),             top2,             intersection(top1, bot1, top2, bot3)};         area += segments * getArea(pts);         cursize = (cursize - 2) / 2;       }       segments *= 2;     }     cout << fixed << setprecision(8) << area <<   n ;     return 0;   }   