#include <bits/stdc++.h>
using namespace std;
struct circ {
  double r;
  double x;
  double c;
};
int main() {
  cerr << fixed << setprecision(12);
  cout << fixed << setprecision(12);
  vector<circ> v;
  long long n;
  double Radi;
  cin >> n >> Radi;
  double x[n], ans[n];
  for (long long i = 0; i < n; i++) cin >> x[i], ans[i] = 0.0;
  v.push_back({Radi, x[0], Radi});
  ans[0] = Radi;
  for (long long i = 1; i < n; i++) {
    long long L = x[i] - Radi;
    long long R = x[i] + Radi;
    double yy = Radi;
    for (auto it : v) {
      long long l = it.x - Radi;
      long long r = it.x + Radi;
      bool ok = false;
      if (r >= L && r <= R)
        ok = true;
      else if (l >= L && l <= R)
        ok = true;
      else if ((L >= l && L <= r) && (R >= l && R <= r))
        ok = true;
      if (ok) {
        double foo = (4.000 * Radi * Radi);
        double bar = fabs(x[i] - it.x) * fabs(x[i] - it.x);
        double shit = sqrt(foo - bar);
        double rek_c = it.c + shit;
        if (rek_c > yy) {
          yy = rek_c;
        }
      }
    }
    ans[i] = yy;
    v.push_back({Radi, x[i], yy});
  }
  for (long long i = 0; i < n; i++) cout << ans[i] << " ";
  cout << endl;
  return 0;
}
