#include <bits/stdc++.h>
using namespace std;
int main() {
  int m, r;
  cin >> m >> r;
  double d0, d1, ans = 0;
  d0 = 2 * r;
  d1 = r * (2 + sqrt(2));
  ans += m * d0 + (2 * m - 2) * d1;
  for (int i = 1; i <= m; i++) {
    double j = i - 2;
    if (j > 0) ans += j * (j + 1) * r + j * 2 * sqrt(2) * r;
  }
  for (int i = 0; i < m; i++) {
    double j = m - i - 2;
    if (j > 0) ans += j * (j + 1) * r + j * 2 * sqrt(2) * r;
  }
  cout << fixed << setprecision(10) << ans / m / m << endl;
  return 0;
}
