#include <bits/stdc++.h>
int m, R;
void init() { scanf("%d%d", &m, &R); }
void solve() {
  long long S(0);
  long long left, right;
  for (int i = 0; i < m; i++) {
    left = i - 1;
    right = m - 2 - i;
    left = left > 0 ? left : 0;
    right = right > 0 ? right : 0;
    S += left * (left + 1) / 2;
    S += right * (right + 1) / 2;
  }
  double ans;
  ans = 2.0 * R * S + 2.0 * R * (3 * m - 2) +
        2.0 * sqrt(2.0) * R * (m - 1) * (m - 1);
  printf("%.10f\n", ans / m / m);
}
int main() {
  init();
  solve();
  return 0;
}
