#include <bits/stdc++.h>
using namespace std;
int main() {
  double n, r;
  cin >> n >> r;
  double S, ss, sss;
  S = 3.14159265358979323846 * r * r;
  ss = 3.14159265358979323846 * r * r / n;
  sss = r * r * sin(2 * 3.14159265358979323846 / n) / 2;
  cout.precision(9);
  cout << fixed
       << S - n * (ss - sss +
                   sss * tan(3.14159265358979323846 / n) /
                       tan(3 * 3.14159265358979323846 / 2 / n));
}
