#include <bits/stdc++.h>
using namespace std;
char _;
inline long long powmod(long long x, long long n, long long _mod) {
  long long res = 1;
  while (n) {
    if (n & 1) res = (res * x) % _mod;
    x = (x * x) % _mod;
    n >>= 1;
  }
  return res;
}
int n, r;
long double maxY[200005];
int a[200005];
long double ans[200005];
long double sq(int x0, int y0, int x2, int y2) {
  return (long double)(x0 - x2) * (x0 - x2) +
         (long double)(y0 - y2) * (y0 - y2);
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  cin >> n >> r;
  for (int i = 0; i < n; ++i) {
    cin >> a[i];
    a[i] += 3000;
  }
  maxY[a[0]] = r;
  ans[0] = r;
  for (int j = 1; j < n; ++j) {
    int x = a[j];
    long double max_x = x, max_y = r;
    for (int i = 1; i <= 6000; i++) {
      if (maxY[i] > 0) {
        if ((abs(x - i)) <= 2 * r) {
          long double s = abs((long double)(2 * r + i - x) * (2 * r - i + x));
          long double y2 = maxY[i] + (long double)sqrt(s);
          max_y = max(max_y, y2);
        }
      }
    }
    maxY[x] = max(maxY[x], max_y);
    ans[j] = max_y;
  }
  for (int i = 0; i < n - 1; ++i) {
    cout << setprecision(10) << ans[i] << ' ';
  }
  cout << setprecision(10) << ans[n - 1] << '\n';
  return 0;
}
