#include <bits/stdc++.h>
using namespace std;
const long double E = 1e-9;
int main() {
  int n, r;
  int x[1001];
  double ans[1001];
  cin >> n >> r;
  for (int i = 0; i < n; i++) {
    cin >> x[i];
  }
  ans[0] = r;
  for (int i = 1; i < n; i++) {
    double L = r, R = 1e9;
    for (int j = 0; j < i; j++) {
      if (abs(x[i] - x[j]) <= 2 * r) L = max(L, ans[j]);
    }
    while (R - L > E) {
      bool ok = true;
      double M = (R + L) / 2;
      for (int j = 0; j < i; j++) {
        double d =
            sqrt((ans[j] - M) * (ans[j] - M) + (x[j] - x[i]) * (x[j] - x[i]));
        if (d < 2 * r) {
          ok = false;
          break;
        }
      }
      if (ok)
        R = M;
      else
        L = M;
    }
    ans[i] = L;
  }
  for (int i = 0; i < n; i++) {
    printf("%0.10f ", ans[i]);
  }
  printf("\n");
  return 0;
}
