#include <bits/stdc++.h>
using namespace std;
int main() {
  long long second = 0;
  int r, m;
  cin >> m >> r;
  long long koef = 0, koef2 = 0;
  for (int i = 1; i <= m; ++i) {
    long long lef = i - 2, rig = m - i - 1;
    if (lef < 0) lef = 0;
    if (rig < 0) rig = 0;
    koef2 += i != 1;
    koef2 += i != m;
    koef += lef + rig;
    second += 2;
    if (i != 1) second += 2;
    if (i != m) second += 2;
    second += (lef + 1) * lef;
    second += (rig + 1) * rig;
  }
  long double ans = second + (2 * koef + koef2) * sqrt(2.0);
  printf("%.10f\n", double(ans / (1LL * m * m) * r));
  return 0;
}
