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