#include <bits/stdc++.h>
using namespace std;
long double n, r, ar[(int)(2e5 + 5)], ar2[(int)(2e5 + 5)];
int main() {
  scanf("%Lf %Lf", &n, &r);
  for (int i = 1; i <= n; i++) scanf("%Lf", &ar[i]);
  for (int i = 1; i <= n; i++) {
    long double ans = r;
    for (int j = 1; j < i; j++) {
      if (abs(ar[j] - ar[i]) > 2 * r) continue;
      ans = max(ans, ar2[j] + sqrt(4 * r * r -
                                   abs(ar[i] - ar[j]) * abs(ar[i] - ar[j])));
    }
    ar2[i] = ans;
    printf("%Lf\n", ans);
  }
}
