#include <bits/stdc++.h>
using namespace std;
int x[1005];
double y[1005];
int main() {
  int n, r;
  scanf("%d%d", &n, &r);
  for (int i = 0; i < n; i++) {
    scanf("%d", x + i);
    y[i] = r;
    for (int j = 0; j < i; j++) {
      double a = 4 * r * r, b = (x[i] - x[j]) * (x[i] - x[j]);
      if (r + r >= ((x[i] - x[j]) < 0 ? -(x[i] - x[j]) : (x[i] - x[j])))
        y[i] = max(y[i], sqrt(a - b) + y[j]);
    }
    printf("%.15lf%c", y[i], " \n"[i + 1 == n]);
  }
  return 0;
}
