#include <bits/stdc++.h>
int main() {
  double n, r;
  while (~scanf("%lf%lf", &n, &r)) {
    double x1, x2, x3;
    x1 = acos(-1.0) / (2.0 * n);
    x2 = 2 * x1;
    x3 = acos(-1.0) - x1 - x2;
    double len = r * sin(x2) / sin(x3);
    double s = 0.5 * len * r * sin(x1) * 2 * n;
    printf("%.8lf\n", s);
  }
  return 0;
}
