#include <bits/stdc++.h>
using namespace std;
bool isV(char c) {
  return c == 'a' || c == 'e' || c == 'i' || c == 'o' || c == 'u';
}
bool isImp(char c) {
  return c == '1' || c == '9' || c == '7' || c == '5' || c == '3';
}
int n, m;
bool estaAdentro(int a, int b) { return a >= 0 && a < n && b >= 0 && b < m; }
const double eps = 0.0000000001;
double dist(int x1, double y1, int x2, double y2) {
  double ret = (x1 - x2) * (x1 - x2) + (y1 - y2) * (y1 - y2);
  return ret;
}
int main() {
  int n, r;
  cin >> n >> r;
  int x[n];
  for (int i = 0; i < (int)(n); i++) cin >> x[i];
  double ans[n];
  for (int i = 0; i < (int)(n); i++) ans[i] = 1.000 * r;
  ans[0] = r;
  double maxi = (double)(r);
  maxi = maxi * maxi;
  maxi = maxi * 4.0000;
  printf("%.2f", ans[0]);
  for (int i = (int)(1); i < (int)(n); i++) {
    for (int j = 0; j < (int)(i); j++) {
      if (abs(x[j] - x[i]) == 2 * r) {
        ans[i] = max(ans[i], ans[j]);
        continue;
      }
      if (abs(x[j] - x[i]) > 2 * r) {
        continue;
      }
      double lo = ans[j], hi = 112345678.0;
      while (hi - lo > eps) {
        double mi = (hi + lo) / 2;
        if (dist(x[i], mi, x[j], ans[j]) - eps > maxi) {
          hi = mi;
        } else {
          lo = mi;
        }
      }
      ans[i] = max(ans[i], hi);
    }
    printf(" %.10f", ans[i]);
  }
}
