#include <bits/stdc++.h>
using namespace std;
int main() {
  cout.setf(ios::fixed);
  cout.precision(12);
  long double m, r;
  cin >> m >> r;
  long double sum = 2 * r * m;
  for (long long i = 1; i < m + 1; i++)
    sum += 2 * r *
               (((i - 1) * (i - 2)) / 2 + (m - i) * (m - i - 1) / 2 +
                (i > 1 ? 1 : 0) + (m - i ? 1 : 0)) +
           max((long double)(0.0), 2 * (i - 2) * sqrt(2 * r * r)) +
           max((long double)(0.0), 2 * (m - i - 1) * sqrt(2 * r * r)) +
           (i - 1 ? sqrt(2 * r * r) : 0) + (m - i ? sqrt(2 * r * r) : 0);
  cout << sum / (m * m);
}
