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