#include <bits/stdc++.h>
using namespace std;
int n, r;
const int maxn = 1e3 + 3;
double x[maxn], y[maxn], a, ans;
int main() {
  cin >> n >> r;
  for (int i = 0; i < n; i++) {
    cin >> x[i];
    y[i] = r;
    for (int j = 0; j < i; j++) {
      a = x[i] - x[j];
      ans = sqrt(4 * r * r - a * a);
      y[i] = max(y[i], y[j] + ans);
    }
    cout << setprecision(7) << y[i] << " ";
  }
  return 0;
}
