#include <bits/stdc++.h>
using namespace std;
long long n, m, i, j, ans, tmp, t, curr, x, sm, k, l, mn, mm;
long double arr[2000005], r, mx, res[2000005];
string s;
vector<long long> vec, vec1[2000005];
int main() {
  ios_base::sync_with_stdio(false);
  cin >> n >> r;
  for (i = 0; i < n; i++) cin >> arr[i];
  cout << setprecision(15);
  cout << r << " ";
  res[0] = r;
  for (i = 1; i < n; i++) {
    mx = r;
    for (j = 0; j < i; j++) {
      if (abs(arr[i] - arr[j]) <= 2 * r) {
        mx = max(mx, abs(res[j] + sqrt(4 * r * r -
                                       (arr[i] - arr[j]) * (arr[i] - arr[j]))));
      }
    }
    res[j] = mx;
    cout << mx << " ";
  }
  return 0;
}
