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