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