#include <bits/stdc++.h>
using namespace std;
const int oo = (int)1e9;
const double PI = 2 * acos(0.0);
const double eps = 1e-9;
long long calc(long long n) {
  if (n <= 0) return 0;
  return (n + 1) * n / 2;
}
int main() {
  ios_base::sync_with_stdio(false);
  long long m, r;
  cin >> m >> r;
  double slope = r * sqrt(2.0);
  double sum = 0;
  for (int i = 0; i < (int)(m); i++) {
    sum += 2 * r;
    if (i > 0) sum += 2 * r + slope;
    if (i < m - 1) sum += 2 * r + slope;
    if (i > 1) sum += 2 * r + slope * 2;
    if (i < m - 2) sum += 2 * r + slope * 2;
    if (i > 2) sum += (2 * r + slope * 2) * (i - 2) + calc(i - 2) * 2 * r;
    if (i < m - 3)
      sum += (2 * r + slope * 2) * (m - i - 3) + calc(m - i - 3) * 2 * r;
  }
  cout << fixed << setprecision(10) << sum / (m * m) << endl;
  return 0;
}
