#include <bits/stdc++.h>
#pragma comment(linker, "/STACK:10000000000")
#pragma GCC optimize("O3")
using namespace std;
const int MOD = 1000000007;
const int INF = 1000000007LL;
const long long INF2 = 1000000007LL * 1000000007LL;
const long double EPS = 1e-9;
const int SIZE = 300100;
mt19937 rng(time(0));
uniform_int_distribution<int> uid(-1000000000, 1000000000);
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  long long n, r;
  cin >> n >> r;
  const double PI = acos(-1);
  double o = PI / n;
  double a = PI / n / 2;
  double ao = r;
  double s = ao * ao / 2 * sin(a) * sin(o) / sin(PI - a - o);
  cout << fixed << setprecision(10) << 2 * n * s;
  return 0;
}
