#include <bits/stdc++.h>
using namespace std;
int main() {
  ios::sync_with_stdio(0);
  cin.tie();
  int n, r;
  cin >> n >> r;
  int x[n];
  long double y[n];
  for (int i = 0; i < n; i++) {
    cin >> x[i];
  }
  for (int i = 0; i < n; i++) {
    y[i] = r;
    for (int j = 0; j < i; j++) {
      if (abs(x[j] - x[i]) <= 2 * r) {
        y[i] =
            max(y[i], y[j] + sqrt(4 * r * r - (x[j] - x[i]) * (x[j] - x[i])));
      }
    }
  }
  for (auto d : y) cout << fixed << setprecision(7) << d << ' ';
}
