#include <bits/stdc++.h>
using namespace std;
int main() {
  int m, r;
  scanf("%d %d", &m, &r);
  double res = 0.0;
  res += (2 * 1.0 * r) * m;
  for (int i = 1; i < m; ++i) {
    int v = i / m + 1;
    int u = m + 1 + i % m;
    if (abs(m - v - (2 * m - u)) == 1)
      res += (r * 2.0 + r * sqrt(2)) * 2.0 * (m - i);
    else
      res += (2.0 * r * sqrt(2) + 2.0 * r +
              (abs(m - v - (2 * m - u)) - 2) * 2.0 * r) *
             (m - i) * 2.0;
  }
  printf("%.6lf\n", res / m / m);
  return 0;
}
