#include <bits/stdc++.h>
using namespace std;
struct cre {
  int id;
  int L;
  int R;
  int y;
};
cre cir[1005];
int cx[1005];
int mp[1005];
double ans[1005];
bool cmp(cre a, cre b) { return a.L < b.L; }
int main() {
  int n, r;
  cin >> n >> r;
  for (int i = 1; i <= n; i++) {
    cin >> cx[i];
    cir[i].id = i;
    cir[i].L = cx[i] - r;
    cir[i].R = cx[i] + r;
  }
  for (int i = 1; i <= n; i++) {
    ans[i] = 0;
    for (int j = i - 1; j >= 1; j--) {
      if (cir[j].L > cir[i].R || cir[j].R < cir[i].L) {
        continue;
      }
      int xx = cx[i] - cx[j];
      long double yy = (4 * r * r) - (xx * xx);
      yy = sqrt(yy);
      yy += ans[j];
      if (yy > ans[i]) ans[i] = yy;
    }
  }
  for (int i = 1; i <= n; i++) {
    printf("%.8f ", ans[i] + r);
  }
  cout << endl;
}
