#include <bits/stdc++.h>
using namespace std;
struct node {
  double x, y;
} a[1005];
int main() {
  ios::sync_with_stdio(false);
  int n;
  double r;
  cin >> n >> r;
  for (int i = 0; i < n; ++i) cin >> a[i].x;
  for (int i = 0; i < n; ++i) {
    a[i].y = r;
    for (int j = 0; j < i; ++j) {
      if (fabs(a[i].x - a[j].x) > 2 * r) continue;
      double dx = fabs(a[i].x - a[j].x);
      a[i].y = max(a[i].y, a[j].y + sqrt(4 * r * r - dx * dx));
    }
  }
  int first = 1;
  for (int i = 0; i < n; ++i) {
    if (!first)
      cout << " " << fixed << setprecision(10) << a[i].y;
    else {
      first = 0;
      cout << fixed << setprecision(10) << a[i].y;
    }
  }
  cout << endl;
}
