#include <bits/stdc++.h>
using namespace std;
const int MAXN = 10000 + 10, inf = 1 << 30;
vector<int> arr[31], e;
int m, r;
int main() {
  cin >> m >> r;
  long double ans = 0;
  long double q = sqrt(2);
  for (int i = 0; i < m; i++) {
    ans += 2 * r;
    if (i > 0) ans += 2 * r + r * q;
    if (i < m - 1) ans += 2 * r + r * q;
    if (i - 1 > 0)
      ans += (2 * r + 2 * r * q) * (i - 1) +
             (1 + i - 1) / 2.0 * (i - 1) * 2 * r - 2 * (i - 1) * r;
    if (m - i - 2 > 0)
      ans += (2 * r + 2 * r * q) * (m - i - 2) +
             (1 + m - i - 2) / 2.0 * (m - i - 2) * 2 * r - 2 * (m - i - 2) * r;
  }
  cout.setf(ios::fixed);
  cout.precision(8);
  cout << ans / m / m << endl;
  return 0;
}
