#include <bits/stdc++.h>
using namespace std;
const int INF = 1e9;
const double eps = 1e-10;
const int MOD = (int)1e9 + 7;
const int N = 100010;
const int M = 99991;
int main() {
  int m, r;
  while (scanf("%d %d", &m, &r) != EOF) {
    if (m == 1) {
      printf("%.10lf\n", 2 * double(r));
      continue;
    }
    double ans = 0;
    for (int i = 1; i <= m; i++) {
      ans += double(m - i) * (m - i - 1) / 2 + double(i - 1) * (i - 2) / 2;
    }
    ans += m + 2 * m - 2;
    ans = ans * 2 * r;
    ans += sqrt(2.0) * 2 * r * (m - 1) * (m - 1);
    ans = ans / m / m;
    printf("%.10lf\n", ans);
  }
  return 0;
}
