#include <bits/stdc++.h>
int n;
double r;
int main() {
  scanf("%d%lf", &n, &r);
  double A, B, C, a, b, c, s = 0;
  a = r;
  B = acos(-1) / (2 * n);
  C = acos(-1) / n;
  A = acos(-1) - B - C;
  b = a * sin(B) / sin(A);
  s = 0.5 * a * b * sin(C);
  s = 2 * n * s;
  printf("%.12f", s);
}
