#include <bits/stdc++.h>
using namespace std;
string tostr(int n) {
  stringstream rr;
  rr << n;
  return rr.str();
}
long long qpow(long long n, long long k) {
  long long ans = 1;
  while (k) {
    if (k & 1) ans = ans * n;
    n = n * n;
    k >>= 1;
  }
  return ans;
}
const int mod = 1e9 + 7;
const int mxn = 1e5 + 9;
const int eps = 1e-9;
int main() {
  ios_base::sync_with_stdio(false), cin.tie(NULL);
  long double i, j, k, r, n, a, b, c, s, area;
  cin >> n >> r;
  a = r;
  c = 3.14159265358979323846 - 3.14159265358979323846 / n -
      3.14159265358979323846 / (2.0 * n);
  b = r * (sin(3.14159265358979323846 / n) / sin(c));
  area = 0.5 * a * b * sin(3.14159265358979323846 / (2.0 * n));
  cout << fixed << setprecision(10) << 2.0 * n * area << "\n";
  return 0;
}
