#include <bits/stdc++.h>
using namespace std;
int n, r;
int x[1000];
long double y[1000];
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout << fixed << setprecision(10);
  cin >> n >> r;
  for (int i = 0; i < n; i++) cin >> x[i];
  for (int i = 0; i < n; i++) {
    long double res = r;
    for (int j = 0; j < i; j++)
      if (abs(x[i] - x[j]) > 2 * r)
        continue;
      else {
        long double t = 0;
        t = sqrt(4 * r * r - (x[i] - x[j]) * (x[i] - x[j]));
        res = max(res, y[j] + t);
      }
    y[i] = res;
    cout << res << ' ';
  }
  return 0;
}
