#include <bits/stdc++.h>
int main() {
  double n, r;
  while (~scanf("%lf%lf", &n, &r)) {
    double A, B, C, a, c, s;
    A = acos(-1.0) / (2.0 * n);
    B = 2 * A;
    C = acos(-1.0) - A - B;
    c = r;
    a = c * sin(A) / sin(C);
    s = 0.5 * a * r * sin(B);
    printf("%.10f\n", 2 * n * s);
  }
  return 0;
}
