#include <bits/stdc++.h>
int m, R;
int main() {
  double ans = 0;
  scanf("%d%d", &m, &R);
  ans = (double)2 * R * m + ((double)m * m - m) * R * sqrt(2);
  for (int i = 0; i <= m - 1; i++)
    ans += double(
        2 * R *
        ((double)i * i + (double)i - (double)i * m + (double)m * (m - 1) / 2));
  ans += (double)(m - 1) * (double)(m - 2) * R * (sqrt(2) - 2);
  printf("%.10lf", ans / (double)((double)m * m));
  return 0;
}
