#include <bits/stdc++.h>
using namespace std;
int a, b, c, d, e, m[1009];
double x, y;
pair<pair<int, int>, double> p[1009];
int main() {
  ios_base::sync_with_stdio(false), cin.tie(0), cout.tie(0);
  cin >> a >> b;
  for (c = 1; c <= a; c++) {
    cin >> m[c];
    m[c] += 2000;
  }
  cout << b << " ";
  p[1].first.first = m[1] - b;
  p[1].first.second = m[1] + b;
  p[1].second = b;
  for (c = 2; c <= a; c++) {
    x = (double)(0);
    for (d = 1; d < c; d++) {
      if ((m[c] - b <= p[d].first.first && m[c] + b >= p[d].first.second) ||
          (m[c] - b >= p[d].first.first && m[c] + b <= p[d].first.second) ||
          (m[c] - b >= p[d].first.first && m[c] - b <= p[d].first.second) ||
          (m[c] + b >= p[d].first.first && m[c] + b <= p[d].first.second)) {
        y = p[d].second +
            sqrt((b * 2) * (b * 2) -
                 (m[c] - p[d].first.first - b) * (m[c] - p[d].first.first - b));
        x = max(x, y);
      }
    }
    if (x == 0) x = b;
    cout << setprecision(13) << x << " ";
    p[c].first.first = m[c] - b;
    p[c].first.second = m[c] + b;
    p[c].second = x;
  }
  return 0;
}
