#include <bits/stdc++.h>
using namespace std;
const long long INF = 1e18 + 10;
const int inf = 1e9 + 10, dx[] = {0, 0, 1, -1, 1, -1, 1, -1},
          dy[] = {1, -1, 0, 0, 1, 1, -1, -1};
long long MOD = 1e9 + 7;
long double eps = 1e-7, pi = acos(-1);
const int MAX = 100100;
int n;
long double r, x[1010], y[1010], a, b, c, delta;
bool get_y(long double x1, long double y1, long double x2, long double &y2) {
  a = 1.0;
  b = -2.0 * y1;
  c = y1 * y1 + pow(x1 - x2, 2) - 4 * r * r;
  if (b * b < 4 * c) return 0;
  delta = sqrt(b * b - 4 * a * c);
  long double ans1 = (-b - delta) / (2.0 * a);
  long double ans2 = (-b + delta) / (2.0 * a);
  y2 = max(ans1, ans2);
}
int main() {
  ios_base::sync_with_stdio(0);
  cin >> n >> r;
  for (int i = 0; i < n; i++) {
    cin >> x[i];
  }
  y[0] = r;
  cout << setprecision(10) << fixed << y[0] << " ";
  for (int i = 1; i < n; i++) {
    long double y2 = -1, ans = -1;
    int all_test = 0;
    for (int j = 0; j < i; j++) {
      all_test += get_y(x[j], y[j], x[i], y2);
      ans = max(ans, y2);
    }
    if (all_test == 0)
      y[i] = r;
    else
      y[i] = ans;
    cout << y[i] << " ";
  }
  return 0;
}
