#include <bits/stdc++.h>
using namespace std;
signed main() {
  ios_base::sync_with_stdio(false);
  long long n;
  long long r;
  cin >> n >> r;
  vector<long long> x(n);
  vector<long double> y(n);
  for (long long i = 0; i < n; i++) {
    cin >> x[i];
  }
  for (long long i = 0; i < n; i++) {
    y[i] = r;
    for (long long j = 0; j < i; j++) {
      long long dst = fabs(x[i] - x[j]);
      if (dst <= 2 * r) {
        y[i] = max(y[i], y[j] + sqrt(4 * r * r - dst * dst));
      }
    }
  }
  cout << fixed << setprecision(20);
  for (long long i = 0; i < n; i++) {
    cout << y[i] << " ";
  }
  cout << endl;
  return 0;
}
