#include <bits/stdc++.h>
using namespace std;
int main() {
  int r, n;
  cin >> n >> r;
  double a = 2 * 2 * acos(0) / n;
  double a1 = a / 2;
  double l = 2 * sin(a1) * r;
  double s1 = l * cos(a1) * r / 2;
  double a2 = a * 1.5;
  double l2 = l * sin((2 * acos(0) - a2) / 2) / sin(a2);
  double p = l2 + l / 2;
  double s2 = sqrt(p * (p - l2) * (p - l2) * (p - l));
  double ans = (s1 - s2) * n;
  printf("%.10lf", ans);
  return 0;
}
