#include <bits/stdc++.h>
#pragma comment(linker, "/STACK:66777216")
using namespace std;
int m;
long double r, sq;
long double f(int x) {
  if (x <= 1) {
    return 0.0;
  }
  long double ret = 0.0;
  ret += r + sq / 2;
  ret += r * (1 + x - 2) * (x - 2) / 2;
  ret += (x - 2) * sq;
  return ret;
}
int main() {
  cin >> m >> r;
  long double L = 0.0;
  r *= 2;
  sq = sqrt(2.0) * r;
  for (int i = 0; i < m; ++i) {
    L += r + f(i + 1) + f(m - i);
  }
  cout << fixed << setprecision(9) << L / m / m << endl;
  return 0;
}
