#include <bits/stdc++.h>
using namespace std;
long long n;
double R;
const double gen2 = sqrt(2.0);
double work() {
  double ans = 0;
  for (long long i = 1; i <= n; i++) {
    double temp = 2 * R * n;
    if (i < n) temp += gen2 * R;
    if (i > 1) temp += gen2 * R;
    if (i > 2) temp = temp + gen2 * R * 2 * (i - 2) + (i - 3) * (i - 2) * R;
    if (i < n - 1)
      temp = temp + gen2 * R * 2 * (n - i - 1) + (n - 2 - i) * (n - i - 1) * R;
    ans = ans + temp / (n * n);
  }
  return ans;
}
int main() {
  cin >> n >> R;
  printf("%.10lf\n", work());
  return 0;
}
