#include <bits/stdc++.h>
using namespace std;
long long const mod = 1000000007;
long long const md = 998244353;
long long mypowr(long long a, long long b) {
  long long res = 1;
  a %= mod;
  assert(b >= 0);
  for (; b; b >>= 1) {
    if (b & 1) res = res * a % mod;
    a = a * a % mod;
  }
  return res;
}
long long mypow(long long a, long long b) {
  long long res = 1;
  assert(b >= 0);
  for (; b; b >>= 1) {
    if (b & 1) res = res * a;
    a = a * a;
  }
  return res;
}
ifstream in("txt.in");
ofstream out("txt.out");
float f[1005];
float h[1005];
int main() {
  cout << fixed << setprecision(12);
  cin.tie(0);
  cout.tie(0);
  ios_base::sync_with_stdio(0);
  long long n;
  float r;
  scanf("%lld%f", &n, &r);
  for (int i = 1; i <= n; ++i) {
    scanf("%f", &f[i]);
  }
  for (int i = 1; i <= n; ++i) {
    float mx = r;
    for (int j = 1; j < i; ++j) {
      double distance = abs(f[i] - f[j]);
      if (distance <= 2 * r) {
        mx = max(mx, h[j] + sqrt(4 * r * r - (f[j] - f[i]) * (f[j] - f[i])));
      }
    }
    h[i] = mx;
    printf("%.15f ", h[i]);
  }
  return 0;
}
