#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  int n;
  double r;
  cin >> n >> r;
  double arr[n], ans[n];
  for (int i = 0; i < n; i++) {
    cin >> arr[i];
  }
  double sol;
  for (int i = 0; i < n; i++) {
    sol = r;
    for (int j = i - 1; j >= 0; j--) {
      if (abs(arr[i] - arr[j]) <= 2 * r) {
        sol = max(sol, sqrt(((2 * r) * (2 * r)) -
                            ((arr[i] - arr[j]) * (arr[i] - arr[j]))) +
                           ans[j]);
      }
    }
    ans[i] = sol;
    cout << fixed << setprecision(10) << ans[i] << " ";
  }
  return 0;
}
