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