#include <bits/stdc++.h>
using namespace std;
int n;
double r;
int h[1005];
double res[1005];
int abs(int x, int y) {
  if (x - y > 0) return x - y;
  return y - x;
}
int main() {
  cin >> n >> r;
  for (int i = 0; i < n; i++) {
    cin >> h[i];
    double rs = r;
    for (int j = 0; j < i; j++) {
      int dx = abs(h[i], h[j]);
      if (dx <= 2 * r) {
        rs = max(rs, res[j] + sqrt(4 * r * r - dx * dx));
      }
    }
    res[i] = rs;
  }
  for (int i = 0; i < n; i++)
    cout << fixed << setprecision(10) << res[i] << " ";
  return 0;
}
