#include <bits/stdc++.h>
using namespace std;
const double X = sqrt(2);
long long m, r;
double ans = 0;
double calc(long long y) {
  if (y == 1) return 0;
  return 2 * X * (y - 1) - X + (y - 2) * (y - 2) + y;
}
int main() {
  cin >> m >> r;
  for (int i = 1; i <= m; i++) {
    int j = m - i + 1;
    ans += (calc(i) + calc(j) + 2) / (double)m;
  }
  printf("%.8lf\n", r * ans / (double)m);
  cin >> m;
}
