#include <bits/stdc++.h>
using namespace std;
const long double EPS = 1e-6;
const int INF = (int)(INT_MAX - 100);
const long long mod = (int)(1e+9 + 7);
const int N = (int)(0);
int main() {
  long long m, r;
  cin >> m >> r;
  double sq = sqrt(1.0 * (2));
  double sum = 2 * m + (2 + sq) * 2 * (m - 1);
  for (int i = (1); i <= (m); i++) {
    long long L = i - 2, R = m - i - 1;
    sum += (3 <= i) * L * (2 + 2 * sq + (L - 1));
    sum += (i <= m - 2) * R * (2 + 2 * sq + (R - 1));
  }
  printf("%.9f\n", r * sum / ((m) * (m)));
  return 0;
}
