#include <bits/stdc++.h>
using namespace std;
const int MAXN = 2e3;
double a[MAXN], ans[MAXN];
double rad;
int main() {
  int n;
  cin >> n >> rad;
  for (int i = 0; i < n; i++) {
    cin >> a[i];
    ans[i] = rad;
  }
  ans[0] = rad;
  for (int i = 1; i < n; i++) {
    for (int j = 0; j < i; j++) {
      double x = a[i], x1 = a[j], y1 = ans[j], y;
      double v = x * x - 2.0 * x * x1 + x1 * x1 + y1 * y1 - 4.0 * rad * rad;
      double d = 4.0 * y1 * y1 - 4.0 * v;
      if (fabs(fabs(x - x1) - 2 * rad) <= 1e-6) {
        ans[i] = max(ans[j], ans[i]);
      } else {
        if (d < 1e-6) continue;
        y = y1 + sqrt(d) / 2.0;
        ans[i] = max(y, ans[i]);
      }
    }
  }
  for (int i = 0; i < n; i++) printf("%.15f ", ans[i]);
  return 0;
}
