#include <bits/stdc++.h>
using namespace std;
const int maxn = 100500;
const int infi = (1 << 30);
const long long infl = (1LL << 62);
const double eps = 1e-9;
const long long mod = 1000000007LL;
const unsigned long long hash_base = 257LL;
const double pi = acos(-1.0);
int n, r;
double ans, cur;
int main() {
  cin >> n >> r;
  ans = 0.0;
  for (int i = 0; i < n; i++) {
    cur = 2.0 * r;
    if (i > 0 && i < n - 1) {
      cur += 2.0 * (sqrt(2.0) * r + 2.0 * r);
      int right = n - i - 2;
      int left = i - 1;
      cur += 2.0 * sqrt(2.0) * r * right +
             (2.0 + 2.0 * (right - 1)) * right * .5 * r;
      cur +=
          2.0 * sqrt(2.0) * r * left + (2.0 + 2.0 * (left - 1)) * left * .5 * r;
      cur += (left + right + .0) * (r + .0);
    } else {
      if (n > 2) {
        cur += sqrt(2.0) * r + 2.0 * r;
        cur += 2.0 * sqrt(2.0) * r * (n - 2) +
               (2.0 + 2.0 * (n - 3)) * (n - 2) * .5 * r;
        cur += (n - 2.0) * r;
      } else {
        cur += sqrt(2.0) * r * (n - 1.0) + 2.0 * r * (n - 1.0);
      }
    }
    ans = ans + (cur / (n + .0));
  }
  ans = ans / (n + .0);
  printf("%.10lf\n", ans);
  return 0;
}
