#include <bits/stdc++.h>
using namespace std;
int main() {
  double n, r, a, b, c, s;
  cin >> n >> r;
  double PI = atan2(0, -1);
  double C = PI / n;
  double B = C / 2;
  double A = PI - B - C;
  a = r;
  c = a * sin(C) / sin(A);
  s = 0.5 * a * c * sin(B);
  printf("%.12lf\n", s * 2.0 * n);
  return 0;
}
