#include <bits/stdc++.h>
using namespace std;
int in[1050];
double ans[1050];
int main() {
  int n, r, i, j;
  cin >> n >> r;
  for (i = 1; i <= n; i++) {
    int x;
    cin >> x;
    in[i] = x;
    double en = r;
    for (j = 1; j < i; j++) {
      int dx = abs(in[j] - in[i]);
      if (dx > 2 * r) continue;
      en = max(en, ans[j] + sqrt(4 * r * r - dx * dx));
    }
    ans[i] = en;
  }
  for (i = 1; i <= n; i++) printf("%.20lf ", ans[i]);
  return !printf("\n");
}
