#include <bits/stdc++.h>
using namespace std;
const int N = 100000;
const int inf = (int)1e9 + 1;
const long long big = (long long)1e18 + 1;
const int P = 239;
const int MOD = (int)1e9 + 7;
const int MOD1 = (int)1e9 + 9;
const long double eps = 1e-9;
const long double pi = atan2(0, -1);
const int ABC = 26;
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.precision(20);
  int n, r;
  cin >> n >> r;
  int x[n];
  for (int i = 0; i < n; i++) cin >> x[i];
  long double ans[n];
  for (int i = 0; i < n; i++) {
    ans[i] = r;
    for (int j = 0; j < i; j++)
      if (abs(x[i] - x[j]) <= r * 2) {
        int dx = abs(x[i] - x[j]);
        ans[i] = max(ans[i], ans[j] + sqrt(4 * r * r - dx * dx));
      }
  }
  for (int i = 0; i < n; i++) cout << ans[i] << " ";
  cout << "\n";
  return 0;
}
