#include <bits/stdc++.h>
const double ax = sqrt(2);
int main() {
  double m, r;
  scanf("%lf%lf", &m, &r);
  double a = 2 * r, b = ax * r;
  double s = 0;
  for (int i = 1; i <= m; i++) {
    s += a;
    if (m - i >= 2)
      s += a + b + (m - i - 1) * (a + 2 * b + (m - i - 1) * a + 2 * b) / 2;
    else if (m - i == 1)
      s += a + b;
    if (i - 1 >= 2)
      s += a + b + (i - 1 - 1) * (a + 2 * b + (i - 1 - 1) * a + 2 * b) / 2;
    else if (i - 1 == 1)
      s += a + b;
  }
  printf("%.10f\n", s / m / m);
  return 0;
}
