#include <bits/stdc++.h>
const double q = acos(-1);
double r, p;
double sqr(double x) { return x * x; }
int main() {
  scanf("%lf %lf", &p, &r);
  double s = sqr(sin(q / p)) / tan(1.5 * q / p) - sin(2.0 * q / p) / 2.0;
  s *= -r * r * p;
  printf("%.15lf\n", s);
  return 0;
}
