#include <bits/stdc++.h>
using namespace std;
const int inf = (int)1.01e9;
const double eps = 1e-9;
namespace point_output {
static char buf[8][30];
static int bufc = 0;
}  // namespace point_output
struct pt {
  double x, y;
  pt() {}
  pt(double xx, double yy) : x(xx), y(yy) {}
  void read() {
    double xx, yy;
    scanf("%lf%lf", &xx, &yy);
    x = xx, y = yy;
  }
  void draw(int color = 0) const {
    printf("point %.4lf %.4lf %d\n", (double)x, (double)y, color);
  }
  void out() const {
    fprintf(stderr, "(%.4lf, %.4lf)\n", (double)x, (double)y), fflush(stderr);
  }
  char *str() const {
    using namespace point_output;
    bufc = (bufc + 1) & 7;
    sprintf(buf[bufc], "%.10lf %.10lf", (double)x, (double)y);
    return buf[bufc];
  }
};
inline pt operator+(pt const &p1, pt const &p2) {
  return pt(p1.x + p2.x, p1.y + p2.y);
}
inline pt operator-(pt const &p1, pt const &p2) {
  return pt(p1.x - p2.x, p1.y - p2.y);
}
inline pt operator*(pt const &p, double c) { return pt(p.x * c, p.y * c); }
inline pt operator*(double c, pt const &p) { return pt(p.x * c, p.y * c); }
inline pt operator/(pt const &p, double c) { return pt(p.x / c, p.y / c); }
inline double vect(pt const &p1, pt const &p2) {
  return p1.x * p2.y - p1.y * p2.x;
}
inline double scal(pt const &p1, pt const &p2) {
  return p1.x * p2.x + p1.y * p2.y;
}
inline double len(pt const &p) { return sqrt(p.x * p.x + p.y * p.y); }
inline double dist(pt const &p1, pt const &p2) {
  double xx = p1.x - p2.x;
  double yy = p1.y - p2.y;
  return sqrt(xx * xx + yy * yy);
}
inline bool operator<(pt const &p1, pt const &p2) {
  return p1.x < p2.x - eps || (abs(p1.x - p2.x) < eps && p1.y < p2.y - eps);
}
inline bool operator>(pt const &p1, pt const &p2) {
  return p1.x > p2.x + eps || (abs(p1.x - p2.x) < eps && p1.y > p2.y + eps);
}
inline bool operator==(pt const &p1, pt const &p2) {
  return abs(p1.x - p2.x) < eps && abs(p1.y - p2.y) < eps;
}
struct line {
  double a, b, c;
  line() {}
  line(double aa, double bb, double cc) : a(aa), b(bb), c(cc) {}
  line(pt const &p1, pt const &p2) {
    a = p1.y - p2.y;
    b = p2.x - p1.x;
    c = p1.x * p2.y - p1.y * p2.x;
  }
  inline double operator()(pt const &p) const { return a * p.x + b * p.y + c; }
  void norm() {
    double dd = sqrt(a * a + b * b);
    a /= dd;
    b /= dd;
    c /= dd;
  }
  void draw(int color = 0) const {
    printf("line %.4lf %.4lf %.4lf %d\n", (double)a, (double)b, (double)c,
           color);
  }
  void out() const {
    fprintf(stderr, "(%.4lf, %.4lf, %.4lf)\n", (double)a, (double)b, (double)c),
        fflush(stderr);
  }
};
inline pt intersect(line const &l1, line const &l2) {
  double D = l1.a * l2.b - l1.b * l2.a;
  return pt((l1.b * l2.c - l2.b * l1.c) / D,
            (l1.a * l2.c - l2.a * l1.c) / (-D));
}
inline pt proj(pt const &p, line const &l) {
  return p - pt(l.a, l.b) * (l(p) / sqrt(l.a * l.a + l.b * l.b));
}
inline double dist(pt const &p, line const &l) {
  return abs(l(p) / sqrt(l.a * l.a + l.b * l.b));
}
inline double dist(line const &l, pt const &p) {
  return abs(l(p) / sqrt(l.a * l.a + l.b * l.b));
}
const double PI = acos(-1);
int n, r;
pt get(int i) {
  double alp = 2 * PI * i / n;
  return pt(cos(alp) * r, sin(alp) * r);
}
int main() {
  cin >> n >> r;
  pt A = get(0), B = get(n / 2);
  pt C = get(1), D = get(n / 2 + 2);
  pt I = intersect(line(A, B), line(C, D));
  pt I2 = pt(I.x, -I.y);
  double S1 = vect(I - A, I2 - A) / 2;
  double rad = len(I);
  double S2 = rad * rad * sin(2 * PI / n) / 2;
  double res = (S1 + S2) * n;
  printf("%.10f\n", res);
  return 0;
}
