#include <bits/stdc++.h>
using namespace std;
const double pi = 3.141592653589793238460;
void solve() {
  long double n, r, x, th, rem;
  cin >> n >> r;
  th = (2 * pi) / n;
  x = pi - ((floor(n / 2) - 1) * (th));
  x /= 2;
  th /= 2;
  rem =
      r * r * cos(th) * sin(th) - (r * r * sin(th) * cos(x) * sin(th)) / sin(x);
  rem *= n;
  cout << fixed << setprecision(8) << rem;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  int t = 1;
  while (t--) solve();
}
