#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, r;
  cin >> n >> r;
  int x[n];
  for (int i = 0; i < n; i++) {
    cin >> x[i];
  }
  double y[n];
  y[0] = r;
  for (int i = 1; i < n; i++) {
    y[i] = r;
    for (int j = 0; j < i; j++) {
      int diff = x[i] - x[j];
      if (diff <= 2 * r) {
        double dy = sqrt(r * r * 4 - diff * diff);
        if (dy + y[j] > y[i]) {
          y[i] = dy + y[j];
        }
      }
    }
  }
  for (int i = 0; i < n; i++) {
    printf("%.6f ", y[i]);
  }
  return 0;
}
