#include <bits/stdc++.h>
using namespace std;
const double eps = 1e-8;
double x[1010], y[1010];
int n;
double r;
int sgn(int x) {
  if (fabs(x) < eps) return 0;
  if (x < 0) return -1;
  return 1;
}
int main() {
  scanf("%d%lf", &n, &r);
  for (int i = 1; i <= n; ++i) scanf("%lf", x + i);
  for (int i = 1; i <= n; ++i) {
    if (i > 1) printf(" ");
    y[i] = r;
    for (int j = 1; j < i; ++j)
      if (sgn(fabs(x[i] - x[j]) - 2 * r) <= 0)
        y[i] =
            max(y[i], y[j] + sqrt(4 * r * r - (x[i] - x[j]) * (x[i] - x[j])));
    printf("%.8f", y[i]);
  }
}
