#include <bits/stdc++.h>
using namespace std;
double count(int n) {
  if (n <= 0) return 0;
  return (double)n * (n + 1) / 2;
}
int main() {
  int m, r;
  cin >> m >> r;
  double ans = 0;
  int num = 0;
  for (int i = 0; i < m; i++) {
    ans += 2 * r * m;
    if (count(i - 1)) {
      ans += (i - 1) * 2 * sqrt(2) * r + (count(i - 1) - (i - 1)) * (2 * r) +
             sqrt(2) * r;
      num += count(i - 1) - (i - 1);
    } else if (i == 1)
      ans += sqrt(2) * r;
    if (count(m - 2 - i)) {
      ans += (m - 2 - i) * 2 * sqrt(2) * r +
             (count(m - 2 - i) - (m - 2 - i)) * 2 * r + sqrt(2) * r;
      num += count(m - 2 - i) - (m - 2 - i);
    } else if (i == m - 2)
      ans += sqrt(2) * r;
  }
  printf("%.10f\n", ans / ((double)m * m));
}
