#include <bits/stdc++.h>
using namespace std;
const int MOD = 1e9 + 7;
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  ;
  int n, r;
  cin >> n >> r;
  vector<double> ans(n), x(n);
  for (int i = 0; i < n; i++) {
    cin >> x[i];
    ans[i] = r;
    for (int j = 0; j < i; j++) {
      int t = x[j] - x[i];
      ans[i] = max(ans[i], ans[j] + sqrt(4 * r * r - t * t));
    }
    cout << fixed;
    cout << setprecision(7) << ans[i] << " ";
  }
  return 0;
}
