#include <bits/stdc++.h>
using namespace std;
long double x[1010], y[1010];
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  int t = 1, n, i, j;
  long double r;
  cin >> n >> r;
  long double lol = 4 * r * r;
  for (i = 0; i < n; i++) {
    cin >> x[i];
    y[i] = r;
  }
  y[0] = r;
  for (int i = 1; i < n; i++)
    for (j = 0; j < i; j++)
      if (abs(x[i] - x[j]) <= 2 * r) {
        long double dist = (x[i] - x[j]) * (x[i] - x[j]);
        y[i] = max(y[i], y[j] + sqrt(lol - dist));
      }
  for (i = 0; i < n; i++) cout << fixed << setprecision(8) << y[i] << "\n";
  return 0;
}
