#include <bits/stdc++.h>
using namespace std;
int main() {
  long long m, r;
  cin >> m >> r;
  double s = m * 2 * r + (m - 1) * 2 * (2 + sqrt(2)) * r;
  for (int i = 2; i < m; i++) {
    int cur = (m - i) * 2;
    s += cur * (2 * sqrt(2) * r + (i - 1) * r * 2);
  }
  printf("%.8lf", s / (m * m));
  cin >> m;
}
