#include <bits/stdc++.h>
#pragma comment(linker, "/STACK:32000000")
#pragma GCC optimize("O3")
using namespace std;
int n, r;
int arr[1024];
double ans[1024];
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  cin.sync_with_stdio(0);
  cout.sync_with_stdio(0);
  cin >> n >> r;
  for (int i = 0; i < n; i++) {
    cin >> arr[i];
    if (!i) {
      ans[i] = r;
      continue;
    }
    double maxans = -1e9 + 7;
    for (int j = 0; j < i; j++) {
      if (r + r + 1e-9 < abs(arr[i] - arr[j])) {
        continue;
      } else {
        double now =
            sqrt((2.0 * r) * (2.0 * r) - (arr[i] - arr[j]) * (arr[i] - arr[j]));
        maxans = max(maxans, ans[j] + now);
      }
    }
    maxans = max(maxans, r * 1.0);
    ans[i] = maxans;
  }
  cout.precision(8);
  for (int i = 0; i < n; i++) {
    cout << fixed << ans[i] << " ";
  }
  return 0;
}
