#include <bits/stdc++.h>
int m, R;
double x, y;
double ans;
int main() {
  while (~scanf("%d%d", &m, &R)) {
    x = y = 0;
    for (int i = 1; i <= m; i++) {
      x += 1.0;
      if (i - 1 > 0) {
        x += 1.0;
        y += 1.0;
      }
      if (i + 1 <= m) {
        x += 1.0;
        y += 1.0;
      }
      if (i - 2 >= 1) {
        double tmp = i - 2;
        y += tmp * 2;
        x += (tmp + 1) * tmp / 2.0;
      }
      if (i + 2 <= m) {
        double tmp = m - i - 1;
        y += tmp * 2;
        x += (tmp + 1) * tmp / 2.0;
      }
    }
    ans = 2.0 * R * x + y * sqrt(2.0) * R;
    ans /= (1.0 * m * m);
    printf("%.10f\n", ans);
  }
  return 0;
}
