#include <bits/stdc++.h>
using namespace std;
long long gcd(long long a, long long b) { return b ? gcd(b, a % b) : a; }
long long lb = 1000;
void vrikodara(long long n = 12) {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  cout << setprecision(n) << fixed;
}
double solve() {
  long long m, R;
  cin >> m >> R;
  double ans = 0;
  double x = R * sqrt(2);
  vector<double> dp(m + 5);
  dp[0] = 2.0 * R;
  dp[1] = 2.0 * R + x;
  dp[2] = dp[1] + x;
  for (long long i = 3; i < m; i++) {
    dp[i] = dp[i - 1] + 2.0 * R;
  }
  vector<double> sum_dp = dp;
  for (long long i = 2; i <= m; i++) {
    sum_dp[i] += sum_dp[i - 1];
  }
  sum_dp[0] = 0;
  for (long long i = 1; i <= m; i++) {
    long long left = i - 1, right = m - i;
    ans += sum_dp[left] + sum_dp[right] + 2.0 * R;
  }
  return ans / (m * m);
}
int32_t main() {
  vrikodara();
  long long t = 1;
  while (t--) {
    cout << solve();
  }
  return 0;
}
