#include <bits/stdc++.h>
using namespace std;
const int N = 1005;
int main() {
  int n, r;
  double height[3 * N];
  int sx, ex;
  int x;
  double y, tempy;
  memset(height, 0, sizeof(height));
  scanf("%d%d", &n, &r);
  for (int i = 0; i < n; i++) {
    scanf("%d", &x);
    sx = max(0, x - 2 * r);
    ex = x + 2 * r;
    tempy = 0;
    y = 0;
    for (int j = sx; j <= ex; j++) {
      if (height[j] > 0) {
        tempy = sqrt(4 * r * r - (x - j) * (x - j)) + height[j];
      } else if (j == x && height[j] == 0) {
        tempy = (double)(r);
      }
      if (tempy > y) {
        y = tempy;
      }
    }
    printf("%.10f\n", y);
    height[x] = y;
  }
  return 0;
}
