#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  long long i, j, k;
  double m, r;
  cin >> m >> r;
  double sum = 0;
  sum += ((2.0 * r) / m);
  double curr = (m - 1);
  double den = (m * m);
  while (curr > 0) {
    if (m - curr == 1) {
      sum += ((2.0 * (curr) * (sqrt(2.0) + 2 * (m - curr)) * r) / den);
    } else {
      sum += ((2.0 * (curr) * (2 * sqrt(2.0) + 2 * (m - curr - 1)) * r) / den);
    }
    curr--;
  }
  cout << fixed << setprecision(10) << sum << '\n';
  return 0;
}
