import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.StringTokenizer;
import java.io.IOException;
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.io.InputStream;

/**
 * Built using CHelper plug-in
 * Actual solution is at the top
 */
public class Main {
    public static void main(String[] args) {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        Scanner in = new Scanner(inputStream);
        PrintWriter out = new PrintWriter(outputStream);
        TaskC solver = new TaskC();
        solver.solve(1, in, out);
        out.close();
    }

    static class TaskC {
        public void solve(int testNumber, Scanner in, PrintWriter out) {
            int n = in.nextInt();
            int r = in.nextInt();
            int[] xs = new int[n];
            for (int i = 0; i < n; i++) xs[i] = in.nextInt();
            double[] ys = new double[n];
            for (int i = 0; i < n; i++) {
                int x = xs[i];
                double y = r;
                for (int j = 0; j < i; j++) {
                    y = Math.max(y, calc(xs[j], ys[j], x, r));
                }
                ys[i] = y;
            }
            for (int i = 0; i < n; i++) {
                out.printf("%.10f ", ys[i]);
            }
            out.println();
        }

        private double calc(int x, double y, int x1, int r) {
            int dx = Math.abs(x - x1);
            if (dx > 2 * r) return 0;
            double dy = Math.sqrt(4 * r * r - dx * dx);
            return y + dy;
        }

    }

    static class Scanner {
        BufferedReader br;
        StringTokenizer st;

        public Scanner(InputStream in) {
            br = new BufferedReader(new InputStreamReader(in), 32768);
        }

        public String nextLine() {
            try {
                return br.readLine();
            } catch (IOException e) {
                return null;
            }
        }

        public boolean hasNext() {
            while (st == null || !st.hasMoreTokens()) {
                String s = nextLine();
                if (s == null)
                    return false;
                st = new StringTokenizer(s);
            }
            return true;
        }

        public String next() {
            hasNext();
            return st.nextToken();
        }

        public int nextInt() {
            return Integer.parseInt(next());
        }

    }
}


import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.*;

public class Codeforces {

    public static void main(String[] args) throws IOException{
        BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
        final double eps = 1e-7;
        String toks[] = in.readLine().split(" ");
        int n = Integer.parseInt(toks[0]);
        double r = Double.parseDouble(toks[1]);
        double x[] = new double[n];
        toks = in.readLine().split(" ");
        for (int i = 0; i < n; i++) {
            x[i] = Double.parseDouble(toks[i]);
        }
        double lo, hi, mid;
        double y[] = new double[n];
        y[0] = r;
        for (int i = 1; i < n; i++) {
            y[i] = r;
            for(int j=0; j<i; j++) {
                lo = y[j]; hi = 2000*2000;
                while( Math.abs(hi-lo) >= eps ) {
                    mid = (hi+lo)/2;
                    if( Math.sqrt( (x[i]-x[j])*(x[i]-x[j]) + (y[j]-mid)*(y[j]-mid) ) + eps > 2*r ) {
                        hi = mid;
                    } else {
                        lo = mid;
                    }
                }
                if(Math.sqrt( (x[i]-x[j])*(x[i]-x[j]) + (y[j]-lo)*(y[j]-lo) ) < 2*r + eps) {
                    y[i] = Math.max(y[i], lo);
                }
            }
        }
        for (double z : y) {
            System.out.printf(Locale.US, "%.7f ", z);
        }
    }
}


import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.TreeSet;
import java.io.BufferedOutputStream;
import java.util.StringTokenizer;
import java.io.BufferedReader;
import java.io.InputStream;

/**
 * Built using CHelper plug-in
 * Actual solution is at the top
 *
 * @author Aeroui
 */
public class Main {
    public static void main(String[] args) {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        Kattio in = new Kattio(inputStream);
        PrintWriter out = new PrintWriter(outputStream);
        TaskC solver = new TaskC();
        solver.solve(1, in, out);
        out.close();
    }

    static class TaskC {
        public void solve(int testNumber, Kattio in, PrintWriter out) {
            int n = in.nextInt();
            int r = in.nextInt();

            double[] xs = new double[n];
            double[] ys = new double[n];
            TreeSet<TaskC.Pair> set = new TreeSet<>();
            for (int i = 0; i < n; ++i) {
                xs[i] = in.nextDouble();
                ys[i] = (double) Integer.MIN_VALUE;

                if (i == 0) { // the first one
                    out.printf("%f", (double) r);
                    ys[i] = (double) r;
                    set.add(new TaskC.Pair(xs[i], ys[i]));
                } else {
                    for (TaskC.Pair p : set) {
                        double maximum = p.x;
                        double diffX = (xs[i] - maximum) * (xs[i] - maximum);

                        if (diffX <= r * r * 4.0) {
                            ys[i] = Math.max(ys[i], p.y + Math.sqrt(r * r * 4.0 - diffX));
                            continue;
                        }
                    }

                    if (ys[i] < 0)
                        ys[i] = (double) r;

                    set.add(new TaskC.Pair(xs[i], ys[i]));
                    out.printf(" %f", ys[i]);
                }
            }

        }

        private static class Pair implements Comparable<TaskC.Pair> {
            double x;
            double y;

            public Pair(double x, double y) {
                this.x = x;
                this.y = y;
            }

            public int compareTo(TaskC.Pair p) {
                if (this.y - p.y < 0)
                    return 1;

                return -1;
            }

        }

    }

    static class Kattio extends PrintWriter {
        private BufferedReader r;
        private String line;
        private StringTokenizer st;
        private String token;

        public Kattio(InputStream i) {
            super(new BufferedOutputStream(System.out));
            r = new BufferedReader(new InputStreamReader(i));
        }

        public Kattio(InputStream i, OutputStream o) {
            super(new BufferedOutputStream(o));
            r = new BufferedReader(new InputStreamReader(i));
        }

        public int nextInt() {
            return Integer.parseInt(nextToken());
        }

        public double nextDouble() {
            return Double.parseDouble(nextToken());
        }

        private String peekToken() {
            if (token == null)
                try {
                    while (st == null || !st.hasMoreTokens()) {
                        line = r.readLine();
                        if (line == null) return null;
                        st = new StringTokenizer(line);
                    }
                    token = st.nextToken();
                } catch (IOException e) {
                }
            return token;
        }

        private String nextToken() {
            String ans = peekToken();
            token = null;
            return ans;
        }

    }
}


import java.io.*;
import java.util.*;

public class C {

	public static void main(String[] args) throws IOException {
		FastScanner in = new FastScanner(System.in);
		PrintWriter out = new PrintWriter(new BufferedWriter(new OutputStreamWriter(System.out)));

		int n = in.nextInt();
		double r = in.nextInt();
		double[] x = new double[n+1];
		double[] y = new double[n+1];
		for (int i = 1; i <= n; i++) {
			x[i] = in.nextInt();
		}

		int[] lastx = new int[1001];
		for (int i = 1; i <= n; i++) {
			double s = x[i] - r, e = x[i] + r;
			for (int j = (int)Math.max(0, s); j <= (int)Math.min(1000, e); j++) {
				if (lastx[j] == 0) {
					y[i] = Math.max(y[i], findY(x[i], x[i], 0 - r, 2 * r));
				}
				else {
					y[i] = Math.max(y[i], findY(x[lastx[j]], x[i], y[lastx[j]], 2 * r));
				}
				lastx[j] = i;
			}
		}

		for (int i = 1; i <= n; i++) {
			out.println(y[i]);
		}
		out.close();
	}

	public static double findY(double x1, double x2, double y1, double d) {
		return Math.max(y1 + Math.sqrt(-1 * Math.pow(x1, 2) + 2 * x1 * x2 + Math.pow(d, 2) - Math.pow(x2, 2)),
				y1 - Math.sqrt(-1 * Math.pow(x1, 2) + 2 * x1 * x2 + Math.pow(d, 2) - Math.pow(x2, 2)));
	}

	static class FastScanner {
		private InputStream stream;
		private byte[] buf = new byte[1024];
		private int curChar;
		private int numChars;

		public FastScanner(InputStream stream) {
			this.stream = stream;
		}

		int read() {
			if (numChars == -1)
				throw new InputMismatchException();
			if (curChar >= numChars) {
				curChar = 0;
				try {
					numChars = stream.read(buf);
				} catch (IOException e) {
					throw new InputMismatchException();
				}
				if (numChars <= 0)
					return -1;
			}
			return buf[curChar++];
		}

		boolean isSpaceChar(int c) {
			return c == ' ' || c == '\n' || c == '\r' || c == '\t' || c == -1;
		}

		boolean isEndline(int c) {
			return c == '\n' || c == '\r' || c == -1;
		}

		public int nextInt() {
			return Integer.parseInt(next());
		}

		public long nextLong() {
			return Long.parseLong(next());
		}

		public double nextDouble() {
			return Double.parseDouble(next());
		}

		public String next() {
			int c = read();
			while (isSpaceChar(c))
				c = read();
			StringBuilder res = new StringBuilder();
			do {
				res.appendCodePoint(c);
				c = read();
			} while (!isSpaceChar(c));
			return res.toString();
		}

		public String nextLine() {
			int c = read();
			while (isEndline(c))
				c = read();
			StringBuilder res = new StringBuilder();
			do {
				res.appendCodePoint(c);
				c = read();
			} while (!isEndline(c));
			return res.toString();
		}
	}

}


import java.math.BigInteger;
import java.util.Scanner;

public class c {

	public static void main(String[] args) {
		Scanner in = new Scanner(System.in);

		int num = in.nextInt();
		int rad = in.nextInt();

		int[] start = new int[num];
		for(int i=0; i<num; i++)
			start[i] = in.nextInt();

		// If you can hack doubles that's dumb
		double[] finalY = new double[num];
		double hyp = rad*2;

		for(int cur=0; cur<num; cur++){

			double stopAt = rad;
			for(int comp=0; comp<cur; comp++){
				if(Math.abs(start[comp]-start[cur]) > rad*2) continue;

				double base = Math.abs(start[comp]-start[cur]);
				double ny = Math.sqrt(hyp*hyp - base*base) + finalY[comp];

				stopAt = Math.max(ny, stopAt);
			}

			finalY[cur] = stopAt;
		}

		for(int i=0; i<num; i++)
			System.out.print(finalY[i]+" ");
		System.out.println();
	}

}


import static java.lang.Math.*;

public class C {

	public C () {
		int N = sc.nextInt(); int R = sc.nextInt();
		int [] X = sc.nextInts();

		double [] res = new double [N];
		for (int i : rep(N)) {
			res[i] = R;
			for (int j : rep(i)) {
				int D = abs(X[i] - X[j]);
				if (D <= 2*R) {
					double H = sqrt(4.0*R*R - 1.0*D*D);
					res [i] = max(res[i], res[j] + H);
				}
			}
		}
		exit(res);
	}

	private static int [] rep(int N) { return rep(0, N); }
	private static int [] rep(int S, int T) { if (T <= S) return new int [0]; int [] res = new int [T-S]; for (int i = S; i < T; ++i) res[i-S] = i; return res; }
	////////////////////////////////////////////////////////////////////////////////////
	private final static IOUtils.MyScanner sc = new IOUtils.MyScanner();
	private static void exit (Object o, Object ... A) { IOUtils.print(o, A); IOUtils.exit(); }
	private static class IOUtils {
		public static class MyScanner {
			public String next() { newLine(); return line[index++]; }
			public int nextInt() { return Integer.parseInt(next()); }
			public String nextLine() { line = null; return readLine(); }
			public String [] nextStrings() { return split(nextLine()); }
			public int [] nextInts() {
				String [] L = nextStrings();
				int [] res = new int [L.length];
				for (int i = 0; i < L.length; ++i)
					res[i] = Integer.parseInt(L[i]);
				return res;
			}
			//////////////////////////////////////////////
			private boolean eol() { return index == line.length; }
			private String readLine() {
				try {
					return r.readLine();
				} catch (Exception e) {
					throw new Error (e);
				}
			}
			private final java.io.BufferedReader r;
			private MyScanner () { this(new java.io.BufferedReader(new java.io.InputStreamReader(System.in))); }
			private MyScanner (java.io.BufferedReader r) {
				try {
					this.r = r;
					while (!r.ready())
						Thread.sleep(1);
					start();
				} catch (Exception e) {
					throw new Error(e);
				}
			}
			private String [] line;
			private int index;
			private void newLine() {
				if (line == null || eol()) {
					line = split(readLine());
					index = 0;
				}
			}
			private String [] split(String s) { return s.length() > 0 ? s.split(" ") : new String [0]; }
		}
		private static String build(Object o, Object ... A) { return buildDelim(" ", o, A); }
		private static String buildDelim(String delim, Object o, Object ... A) {
			StringBuilder b = new StringBuilder();
			append(b, o, delim);
			for (Object p : A)
				append(b, p, delim);
			return b.substring(delim.length());
		}
		//////////////////////////////////////////////////////////////////////////////////
		private static void start() { if (t == 0) t = millis(); }
		private static void append(StringBuilder b, Object o, String delim) {
			if (o.getClass().isArray()) {
				int len = java.lang.reflect.Array.getLength(o);
				for (int i = 0; i < len; ++i)
					append(b, java.lang.reflect.Array.get(o, i), delim);
			} else if (o instanceof Iterable<?>)
				for (Object p : (Iterable<?>) o)
					append(b, p, delim);
			else {
				if (o instanceof Double)
					o = new java.text.DecimalFormat("#.############").format(o);
				b.append(delim).append(o);
			}
		}
		private static java.io.PrintWriter pw = new java.io.PrintWriter(System.out);
		private static void print(Object o, Object ... A) { pw.println(build(o, A)); }
		private static void err(Object o, Object ... A) { System.err.println(build(o, A)); }
		private static void exit() {
			IOUtils.pw.close();
			System.out.flush();
			err("------------------");
			err(IOUtils.time());
			System.exit(0);
		}
		private static long t;
		private static long millis() { return System.currentTimeMillis(); }
		private static String time() { return "Time: " + (millis() - t) / 1000.0; }
	}
	public static void main (String[] args) { new C(); IOUtils.exit(); }
}


import java.io.*;
import java.util.*;
import java.lang.*;
import java.math.*;
public class USACO {
    public static void main(String[] args) throws IOException {
        BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
        StringTokenizer st = new StringTokenizer(reader.readLine()," ");
        int n= Integer.parseInt(st.nextToken());
        int r= Integer.parseInt(st.nextToken());
        StringTokenizer st2 = new StringTokenizer(reader.readLine()," ");
        double[][] coord = new double[n][2];
        for (int i=0;i<n;i++) {
            coord[i][0] = Integer.parseInt(st2.nextToken());
            double y=r;
            for (int j=0;j<i;j++) {
                if (coord[j][0]<=coord[i][0]+2*r&&coord[j][0]>=coord[i][0]-2*r) {
                    if (coord[j][1]+Math.sqrt(4*r*r-(coord[i][0]-coord[j][0])*(coord[i][0]-coord[j][0]))>y) {
                        y=coord[j][1]+Math.sqrt(4*r*r-(coord[i][0]-coord[j][0])*(coord[i][0]-coord[j][0]));
                    }
                }
            }
            coord[i][1]=y;
        }
        for (int i=0;i<n;i++) {
            System.out.print(coord[i][1]);
            if (i<n-1) {
                System.out.print(" ");
            } else {
                System.out.print("\n");
            }
        }
        reader.close();
    }
}


import java.util.Optional;
import java.util.Scanner;
import java.util.StringJoiner;

public class Main {
	public static void main(String[] args) {
		Main main = new Main();
		main.solveC();
	}

	private void solveA() {
		Scanner sc = new Scanner(System.in);
		String str = sc.next();
		long answer = str.chars().filter(
				asc -> asc == 'a'
					|| asc == 'i'
					|| asc == 'u'
					|| asc == 'e'
					|| asc == 'o'
					|| asc == '1'
					|| asc == '3'
					|| asc == '5'
					|| asc == '7'
					|| asc == '9').count();
		System.out.println(answer);
	}

	private void solveB() {
		Scanner sc = new Scanner(System.in);
		int N = sc.nextInt();
		int M = sc.nextInt();
		sc.nextLine();
		char[][] map = new char[N + 2][M + 2];
		map[0] = new char[M + 2];
		map[N + 1] = new char[M + 2];
		int s_r = -1;
		int s_c = -1;
		for (int c = 0; c < M + 2; c++) {
			map[0][c] = '#';
			map[N + 1][c] = '#';
		}
		for (int r = 1; r <= N; r++) {
			map[r][0] = '#';
			String line = sc.nextLine();
			for (int c = 1; c <= M; c++) {
				map[r][c] = line.charAt(c - 1);
				if (map[r][c] == 'S') {
					s_r = r;
					s_c = c;
				}
			}
			map[r][M + 1] = '#';
		}
		String inst = sc.next();
		long ans = 0L;
		for (int left = 0; left < 4; left++) {
			for (int up = 0; up < 4; up++) {
				for (int right = 0; right < 4; right++) {
					for (int down = 0; down < 4; down++) {
						if (left == up || left == right || left == down || up == right || up == down || right == down) {
							continue;
						}
						int r_r = s_r;
						int r_c = s_c;
						for (int i = 0; i < inst.length(); i++) {
							char asc = inst.charAt(i);
							if (asc == '0' + left) {
								r_c--;
							}
							if (asc == '0' + up) {
								r_r--;
							}
							if (asc == '0' + right) {
								r_c++;
							}
							if (asc == '0' + down) {
								r_r++;
							}
							if (map[r_r][r_c] == '#') {
								break;
							}
							if (map[r_r][r_c] == 'E') {
								ans++;
								break;
							}
						}
					}
				}
			}
		}
		System.out.println(ans);
	}

	private void solveC() {
		Scanner sc = new Scanner(System.in);
		int N = sc.nextInt();
		double R = 0.0 + sc.nextInt();
		double[] x = new double[N];
		double[] y = new double[N];
		for (int i = 0; i < N; i++) {
			x[i] = 0.0 + sc.nextInt();
			double max_y = R;
			for (int j = 0; j < i; j++) {
				double dy = 4 * R * R - (x[i] - x[j]) * (x[i] - x[j]);
				if (dy >= 0) {
					double tmp_y = y[j] + Math.sqrt(dy);
					if (max_y < tmp_y) {
						max_y = tmp_y;
					}
				}
			}
			y[i] = max_y;
		}
		StringJoiner sj = new StringJoiner(" ");
		for (int i = 0; i < N; i++) {
			sj.add(String.valueOf(y[i]));
		}
		System.out.println(sj.toString());
	}

	private void solveD() {
		Scanner sc = new Scanner(System.in);
		int N = sc.nextInt();
		System.out.println(N);
	}

	private void solveE() {
		Scanner sc = new Scanner(System.in);
		int N = sc.nextInt();
		System.out.println(N);
	}

	private void solveF() {
		Scanner sc = new Scanner(System.in);
		int N = sc.nextInt();
		System.out.println(N);
	}

	interface Graph {
		void link(int from, int to, long cost);
		Optional<Long> getCost(int from, int to);
		int getVertexNum();
	}

	interface FlowResolver {
		long maxFlow(int from, int to);
	}

	/**
	 * グラフの行列による実装
	 * 接点数の大きいグラフで使うとMLEで死にそう
	 */
	class ArrayGraph implements Graph {
		private Long[][] costArray;
		private int vertexNum;

		public ArrayGraph(int n) {
			costArray = new Long[n][];
			for (int i = 0; i < n; i++) {
				costArray[i] = new Long[n];
			}
			vertexNum = n;
		}

		@Override
		public void link(int from, int to, long cost) {
			costArray[from][to] = new Long(cost);
		}

		@Override
		public Optional<Long> getCost(int from, int to) {
			return Optional.ofNullable(costArray[from][to]);
		}

		@Override
		public int getVertexNum() {
			return vertexNum;
		}
	}

	/**
	 * DFS(深さ優先探索)による実装
	 * 計算量はO(E*MaxFlow)のはず (E:辺の数, MaxFlow:最大フロー)
	 */
	class DfsFlowResolver implements FlowResolver {
		private Graph graph;
		public DfsFlowResolver(Graph graph) {
			this.graph = graph;
		}

		/**
		 * 最大フロー(最小カット)を求める
		 * @param from 始点(source)のID
		 * @param to 終点(target)のID
		 * @return 最大フロー(最小カット)
		 */
		public long maxFlow(int from, int to) {
			long sum = 0L;
			long currentFlow;
			do {
				currentFlow = flow(from, to, Long.MAX_VALUE / 3, new boolean[graph.getVertexNum()]);
				sum += currentFlow;
			} while (currentFlow > 0);
			return sum;
		}

		/**
		 * フローの実行 グラフの更新も行う
		 * @param from 現在いる節点のID
		 * @param to 終点(target)のID
		 * @param current_flow ここまでの流量
		 * @param passed 既に通った節点か否かを格納した配列
		 * @return 終点(target)に流した流量/戻りのグラフの流量
		 */
		private long flow(int from, int to, long current_flow, boolean[] passed) {
			passed[from] = true;
			if (from == to) {
				return current_flow;
			}
			for (int id = 0; id < graph.getVertexNum(); id++) {
				if (passed[id]) {
					continue;
				}
				Optional<Long> cost = graph.getCost(from, id);
				if (cost.orElse(0L) > 0) {
					long nextFlow = current_flow < cost.get() ? current_flow : cost.get();
					long returnFlow = flow(id, to, nextFlow, passed);
					if (returnFlow > 0) {
						graph.link(from, id, cost.get() - returnFlow);
						graph.link(id, from, graph.getCost(id, from).orElse(0L) + returnFlow);
						return returnFlow;
					}
				}
			}
			return 0L;
		}
	}

	/**
	 * 1-indexedのBIT配列
	 */
	class BinaryIndexedTree {
		private long[] array;

		public BinaryIndexedTree(int size) {
			this.array = new long[size + 1];
		}

		/**
		 * 指定した要素に値を加算する
		 * 計算量はO(logN)
		 * @param index 加算する要素の添字
		 * @param value 加算する量
		 */
		public void add(int index, long value) {
			for (int i = index; i < array.length; i += (i & -i)) {
				array[i] += value;
			}
		}

		/**
		 * 1〜指定した要素までの和を取得する
		 * 計算量はO(logN)
		 * @param index 和の終端
		 * @return 1〜indexまでの和
		 */
		public long getSum(int index) {
			long sum = 0L;
			for (int i = index; i > 0; i -= (i & -i)) {
				sum += array[i];
			}
			return sum;
		}
	}
}


import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.io.PrintWriter;
import java.util.Arrays;
import java.io.BufferedWriter;
import java.io.IOException;
import java.io.InputStreamReader;
import java.math.BigDecimal;
import java.util.StringTokenizer;
import java.io.Writer;
import java.io.OutputStreamWriter;
import java.io.BufferedReader;
import java.io.InputStream;

/**
 * Built using CHelper plug-in
 * Actual solution is at the top
 *
 * @author phantom11
 */
public class Main {
    public static void main(String[] args) {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        InputReader in = new InputReader(inputStream);
        OutputWriter out = new OutputWriter(outputStream);
        TaskC solver = new TaskC();
        solver.solve(1, in, out);
        out.close();
    }

    static class TaskC {
        public void solve(int testNumber, InputReader in, OutputWriter out) {
            int N = in.nextInt();
            int r = in.nextInt();
            int i, j;
            BigDecimal initial = new BigDecimal(10);
            initial = initial.pow(100);
            int x[] = new int[N];
            BigDecimal y[] = new BigDecimal[N];
            Arrays.fill(y, initial);
            for (i = 0; i < N; i++) {
                x[i] = in.nextInt();
            }
            for (i = 0; i < N; i++) {
                BigDecimal y2 = new BigDecimal(r);
                for (j = 0; j < i; j++) {
                    if (Math.abs(x[i] - x[j]) <= 2 * r) {
                        double xDiff = x[i] - x[j];
                        xDiff *= xDiff;
                        xDiff = 4 * r * r - xDiff;
                        xDiff = Math.sqrt(xDiff);
                        BigDecimal yNew = new BigDecimal(xDiff);
                        yNew = yNew.add(y[j]);
                        if (yNew.compareTo(y2) > 0) {
                            y2 = yNew;
                        }
                    }
                }
                y[i] = y2;
            }
            for (i = 0; i < N; i++) {
                out.print(y[i] + " ");
            }
        }

    }

    static class InputReader {
        BufferedReader in;
        StringTokenizer tokenizer = null;

        public InputReader(InputStream inputStream) {
            in = new BufferedReader(new InputStreamReader(inputStream));
        }

        public String next() {
            try {
                while (tokenizer == null || !tokenizer.hasMoreTokens()) {
                    tokenizer = new StringTokenizer(in.readLine());
                }
                return tokenizer.nextToken();
            } catch (IOException e) {
                return null;
            }
        }

        public int nextInt() {
            return Integer.parseInt(next());
        }

    }

    static class OutputWriter {
        private final PrintWriter writer;

        public OutputWriter(OutputStream outputStream) {
            writer = new PrintWriter(new BufferedWriter(new OutputStreamWriter(outputStream)));
        }

        public OutputWriter(Writer writer) {
            this.writer = new PrintWriter(writer);
        }

        public void print(Object... objects) {
            for (int i = 0; i < objects.length; i++) {
                if (i != 0)
                    writer.print(' ');
                writer.print(objects[i]);
            }
        }

        public void close() {
            writer.close();
        }

    }
}


//package GoodBye2017;

import java.io.*;
import java.util.*;

public class c {
	public static void main(String[] args) throws Exception{ new c(new Reader()); }
	public c(Reader rr) throws IOException{
		int n=rr.ni();
		double r=rr.nd();
		HashMap<Integer, Double> disk=new HashMap<Integer, Double>();
		for(int i=0; i<n; i++){
			int next=rr.ni();
			if(disk.isEmpty()){
				disk.put(next, r);
				System.out.print(r+" ");
			}
			else{
				double high=r;
				for(Map.Entry<Integer, Double> it: disk.entrySet()){
					if(2*r<next-it.getKey()) continue;
					double tempHigh=pyth(Math.abs(next-it.getKey()),r*2)+it.getValue();
					if(tempHigh>high){
						high=tempHigh;
					}
				}
				disk.put(next, high);
				System.out.print(high+" ");
			}
		}
	}
	public double pyth(double a, double c){
		return Math.sqrt(Math.pow(c, 2)-Math.pow(a, 2));
	}
	static class Reader{
		private DataInputStream din;
		private byte[] buffer=new byte[1024];
		private int bufP, bytR;
		public Reader() throws IOException{
			din=new DataInputStream(System.in);
			bufP=bytR=0;
		}
		public Reader(String file) throws IOException{
			din=new DataInputStream(new FileInputStream(file));
			bufP=bytR=0;
		}
		private String rl() throws IOException{
			byte[] buf=new byte[1024];
			int cnt=0, c;
			while((c=read())!=-1){
				if(c=='\n') break;
				buf[cnt++]=(byte)c;
			}
			return new String(buf, 0, cnt);
		}
		private int ni() throws IOException{
			int num=0;
			byte c=read();
			while(c<=' ') c=read();
			boolean neg=(c=='-');
			if(neg) c=read();
			do{
				num=num*10+c-'0';
			} while((c=read())>='0'&&c<='9');
			if(neg) return -num;
			return num;
		}
		private long nl() throws IOException{
			long num=0;
			byte c=read();
			while(c<=' ') c=read();
			boolean neg=(c=='-');
			if(neg) c=read();
			do{
				num=num*10+c-'0';
			} while((c=read())>='0'&&c<='9');
			if(neg) return -num;
			return num;
		}
		private double nd() throws IOException{ return Double.parseDouble(ns()); }
		private char nc() throws IOException{ return (char)next(); }
		private String ns() throws IOException{
			int c=next();
			StringBuilder sb=new StringBuilder();
			while(!(isChar(c))){
				sb.appendCodePoint(c);
				c=read();
			}
			return sb.toString();
		}
		private char[] ns(int n) throws IOException{
			char[] buf=new char[n];
			int c=next(), r=0;
			while(r<n&&!(isChar(c))){
				buf[r++]=(char)c;
				c=next();
			}
			return n==r?buf:Arrays.copyOf(buf, r);
		}
		private char[][] nm(int n, int m) throws IOException{
			char[][] map=new char[n][];
			for(int i=0; i<n; i++) map[i]=ns(m);
			return map;
		}
		private int[] na(int n) throws IOException{
			int[] a=new int[n];
			for(int i=0; i<n; i++) a[i]=ni();
			return a;
		}
		private boolean isChar(int c) throws IOException{ return !(c>=33&&c<=126); }
		private int next() throws IOException{ int c; while((c=read())!=-1&&isChar(c)); return c; }
		private byte read() throws IOException{
			if(bufP==bytR){
				bytR=din.read(buffer, bufP=0, 1024);
				if(bytR==-1) buffer[0]=-1;
			}
			return buffer[bufP++];
		}
		public void close() throws IOException{
			if(din==null) return;
			din.close();
		}
	}
}


import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.HashSet;
import java.util.StringTokenizer;
import java.util.TreeMap;
import java.util.TreeSet;

public class c {

	public static void main(String args[]) throws IOException {
		FastScanner in = new FastScanner(System.in);
		PrintWriter out = new PrintWriter(System.out);
		//BEGIN HERE
		int n = in.nextInt();
		int r = in.nextInt();
		int xs[] = new int[n];
		for(int i = 0; i < n; i++) xs[i] = in.nextInt();
		double ys[] = new double[n];
		ys[0] = r;
		for(int i = 1; i < n; i++) {
			double worst = r;
			for(int j = 0; j < i; j++) {
				if(xs[i] == xs[j]) {
					worst = Math.max(worst, ys[j] + r + r);
				}else if((xs[i] - xs[j]) * (xs[i] - xs[j]) <= 4*r*r ) {

					double hypot = r + r;
					double adj = Math.abs((xs[i] - xs[j]));
					double theta = Math.acos(adj/hypot);
					worst = Math.max(hypot * Math.sin(theta) + ys[j], worst);
				}
			}
			ys[i] = worst;
		}
		for(int i = 0; i < n; i++)
			out.printf("%.10f ",ys[i]);
		out.close();
	}

	static class FastScanner {
		BufferedReader br;
		StringTokenizer st;

		public FastScanner(InputStream i) {
			br = new BufferedReader(new InputStreamReader(i));
			st = null;
		}

		public String next() throws IOException {
			while (st == null || !st.hasMoreTokens())
				st = new StringTokenizer(br.readLine());
			return st.nextToken();
		}

		public String nextLine() throws IOException {
			if (st == null) {
				st = new StringTokenizer(br.readLine());
			}
			String line = st.nextToken("\n");
			st = null;
			return line;
		}

		public int nextInt() throws IOException {
			return Integer.parseInt(next());
		}

		public long nextLong() throws IOException {
			return Long.parseLong(next());
		}

		public double nextDouble() throws IOException {
			return Double.parseDouble(next());
		}
	}

	public static class combinatorics {
		static long modInv(long a, long b) {
			return 1 < a ? b - modInv(b % a, a) * b / a : 1;
		}

		static long factorial[], mod;

		combinatorics(int n, long MOD) {
			mod = MOD;
			factorial = new long[n + 1];
			factorial[0] = 1;
			for (int i = 1; i <= n; i++) {
				factorial[i] = i * factorial[i - 1];
				factorial[i] %= mod;
			}
		}

		static long nCr(int n, int r) {
			if (r > n)
				return 0;
			return (factorial[n] * modInv((factorial[n - r] * factorial[r]) % mod, mod)) % mod;
		}

		static long gcd(long a, long b) {
			return b == 0 ? a : gcd(b, a % b);
		}

		static long lcm(long a, long b) {
			return a * (b / gcd(a, b));
		}
	}

	public static class DisjointSet {
		int p[], r[], s[];
		int numDisjoint;

		DisjointSet(int N) {
			numDisjoint = N;
			r = new int[N];
			s = new int[N];
			p = new int[N];
			for (int i = 0; i < N; i++)
				p[i] = i;
		}

		int findSet(int i) {
			return (p[i] == i) ? i : (p[i] = findSet(p[i]));
		}

		boolean isSameSet(int i, int j) {
			return findSet(i) == findSet(j);
		}

		void unionSet(int i, int j) {
			if (!isSameSet(i, j)) // if from different set
			{
				numDisjoint--;
				int x = findSet(i), y = findSet(j);
				if (r[x] > r[y]) {
					p[y] = x; // rank keeps the tree short
					s[x] += s[y];
				} else {
					p[x] = y;
					if (r[x] == r[y])
						r[y]++;
					s[y] += s[x];
				}
			}
		}

		int sizeOfSet(int i) {
			return s[findSet(i)];
		}
	};

}


import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.InputMismatchException;
import java.io.IOException;
import java.util.ArrayList;
import java.io.InputStream;

/**
 * Built using CHelper plug-in
 * Actual solution is at the top
 *
 * @author Pradyumn
 */
public class Main {
    public static void main(String[] args) {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        FastReader in = new FastReader(inputStream);
        PrintWriter out = new PrintWriter(outputStream);
        TaskC solver = new TaskC();
        solver.solve(1, in, out);
        out.close();
    }

    static class TaskC {
        public void solve(int testNumber, FastReader in, PrintWriter out) {
            Debug debug = new Debug(out);
            int n = in.nextInt();
            TaskC.Circle[] c = new TaskC.Circle[n];
            double rr = in.nextInt();
            for (int i = 0; i < n; ++i) {
                c[i] = new TaskC.Circle();
                c[i].x = in.nextInt();
            }
            ArrayList<TaskC.Circle> done = new ArrayList<>();
            for (int i = 0; i < n; ++i) {
                TaskC.Circle cur = c[i];
                double ans = Double.MIN_VALUE;
                for (int j = 0; j < done.size(); ++j) {
                    TaskC.Circle dd = done.get(j);
                    if (Double.compare(2 * rr, Math.abs(dd.x - cur.x)) < 0) continue;
                    double temp = Math.sqrt(4 * rr * rr - (cur.x - dd.x) * (cur.x - dd.x)) + dd.y;
                    ans = Math.max(ans, temp);
                }
                if (ans == Double.MIN_VALUE)
                    ans = rr;
                cur.y = ans;
                done.add(cur);
            }
            for (TaskC.Circle cc : done) {
                out.printf("%.12f ", cc.y);
            }
        }

        static class Circle implements Comparable<TaskC.Circle> {
            double x;
            double y;

            public boolean equals(Object o) {
                if (o == null) return false;
                if (o == this) return true;
                if (o.getClass() != this.getClass()) return false;

                TaskC.Circle c = (TaskC.Circle) o;
                return Double.compare(x, c.x) == 0 && Double.compare(y, c.y) == 0;
            }

            public int compareTo(TaskC.Circle o) {
                if (Double.compare(o.x, x) != 0) {
                    return Double.compare(x, o.x);
                }
                return Double.compare(y, o.y);
            }

        }

    }

    static class Debug {
        PrintWriter out;
        boolean oj;
        long timeBegin;
        Runtime runtime;

        public Debug(PrintWriter out) {
            oj = System.getProperty("ONLINE_JUDGE") != null;
            this.out = out;
            this.timeBegin = System.currentTimeMillis();
            this.runtime = Runtime.getRuntime();
        }

    }

    static class FastReader {
        private InputStream stream;
        private byte[] buf = new byte[8192];
        private int curChar;
        private int pnumChars;

        public FastReader(InputStream stream) {
            this.stream = stream;
        }

        private int pread() {
            if (pnumChars == -1) {
                throw new InputMismatchException();
            }
            if (curChar >= pnumChars) {
                curChar = 0;
                try {
                    pnumChars = stream.read(buf);
                } catch (IOException e) {
                    throw new InputMismatchException();
                }
                if (pnumChars <= 0) {
                    return -1;
                }
            }
            return buf[curChar++];
        }

        public int nextInt() {
            int c = pread();
            while (isSpaceChar(c))
                c = pread();
            int sgn = 1;
            if (c == '-') {
                sgn = -1;
                c = pread();
            }
            int res = 0;
            do {
                if (c == ',') {
                    c = pread();
                }
                if (c < '0' || c > '9') {
                    throw new InputMismatchException();
                }
                res *= 10;
                res += c - '0';
                c = pread();
            } while (!isSpaceChar(c));
            return res * sgn;
        }

        private boolean isSpaceChar(int c) {
            return c == ' ' || c == '\n' || c == '\r' || c == '\t' || c == -1;
        }

    }
}


/**
 * Created by Ariana Herbst on 12/29/17.
 */

import java.util.*;
import java.io.*;

/**
 * Created by Ariana Herbst on 12/29/17
 */
public class GB2017C {
    static int n, r;
    static int[] x;
    static Map<Integer, Double> horo;
    public static void main(String[] args) {
        FastScanner sc = new FastScanner();
        StringBuilder sb = new StringBuilder();
        n = sc.nextInt();
        r = sc.nextInt();
        x = new int[n];
        horo = new HashMap<Integer, Double>();
        for (int x = 0; x <= r*2; x++) {
            double y = 2.0 *Math.sqrt(r * r - (r - x/2.0) * (r - x/2.0));
            horo.put(x, y);
        }
        for (int i = 0; i < n; i++) {
            x[i] = sc.nextInt();
        }
        List<Double> y = new ArrayList<Double>();
        for (int i = 0; i < n; i++) {
            double max = r;
            for (int j = 0; j < y.size(); j++) {
                int dx = intersects(i, j);
                if (dx >= 0) {
                    double dy = horo.get(dx);
                    max = Math.max(max, dy + y.get(j));
                }
            }
            y.add(max);
        }
        for (int i = 0; i < n; i++) {
            sb.append(y.get(i) + " ");
        }
        System.out.println(sb);
    }

    static int intersects(int i, int j) {
        if (Math.abs(x[i] - x[j]) <= 2*r) {
            return 2*r - Math.abs(x[i] - x[j]);
        } else
            return -1;
    }

    public static class FastScanner {
        BufferedReader br;
        StringTokenizer st;

        public FastScanner(Reader in) {
            br = new BufferedReader(in);
        }

        public FastScanner() {
            this(new InputStreamReader(System.in));
        }

        String next() {
            while (st == null || !st.hasMoreElements()) {
                try {
                    st = new StringTokenizer(br.readLine());
                } catch (IOException e) {
                    e.printStackTrace();
                }
            }
            return st.nextToken();
        }

        int nextInt() {
            return Integer.parseInt(next());
        }

        long nextLong() {
            return Long.parseLong(next());
        }

        double nextDouble() {
            return Double.parseDouble(next());
        }

        String readNextLine() {
            String str = "";
            try {
                str = br.readLine();
            } catch (IOException e) {
                e.printStackTrace();
            }
            return str;
        }

        int[] readIntArray(int n) {
            int[] a = new int[n];
            for (int idx = 0; idx < n; idx++) {
                a[idx] = nextInt();
            }
            return a;
        }

        long[] readLongArray(int n) {
            long[] a = new long[n];
            for (int idx = 0; idx < n; idx++) {
                a[idx] = nextLong();
            }
            return a;
        }
    }
}


					import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.util.HashMap;
import java.util.InputMismatchException;
public class Solution1 implements Runnable
{
	static final int MAX = 1000000007;
	static class InputReader
	{
		private InputStream stream;
		private byte[] buf = new byte[1024];
		private int curChar;
		private int numChars;
		private SpaceCharFilter filter;
		private BufferedReader br=new BufferedReader(new InputStreamReader(System.in));

		public InputReader(InputStream stream)
		{
			this.stream = stream;
		}

		public int read()
		{
			if (numChars==-1)
				throw new InputMismatchException();

			if (curChar >= numChars)
			{
				curChar = 0;
				try
				{
					numChars = stream.read(buf);
				}
				catch (IOException e)
				{
					throw new InputMismatchException();
				}

				if(numChars <= 0)
					return -1;
			}
			return buf[curChar++];
		}

		public String nextLine()
		{
			String str = "";
            try
            {
                str = br.readLine();
            }
            catch (IOException e)
            {
                e.printStackTrace();
            }
            return str;
		}
		public int nextInt()
		{
			int c = read();

			while(isSpaceChar(c))
				c = read();

			int sgn = 1;

			if (c == '-')
			{
				sgn = -1;
				c = read();
			}

			int res = 0;
			do
			{
				if(c<'0'||c>'9')
					throw new InputMismatchException();
				res *= 10;
				res += c - '0';
				c = read();
			}
			while (!isSpaceChar(c));

			return res * sgn;
		}

		public long nextLong()
		{
			int c = read();
			while (isSpaceChar(c))
				c = read();
			int sgn = 1;
			if (c == '-')
			{
				sgn = -1;
				c = read();
			}
			long res = 0;

			do
			{
				if (c < '0' || c > '9')
					throw new InputMismatchException();
				res *= 10;
				res += c - '0';
				c = read();
			}
			while (!isSpaceChar(c));
				return res * sgn;
		}

		public double nextDouble()
		{
			int c = read();
			while (isSpaceChar(c))
				c = read();
			int sgn = 1;
			if (c == '-')
			{
				sgn = -1;
				c = read();
			}
			double res = 0;
			while (!isSpaceChar(c) && c != '.')
			{
				if (c == 'e' || c == 'E')
					return res * Math.pow(10, nextInt());
				if (c < '0' || c > '9')
					throw new InputMismatchException();
				res *= 10;
				res += c - '0';
				c = read();
			}
			if (c == '.')
			{
				c = read();
				double m = 1;
				while (!isSpaceChar(c))
				{
					if (c == 'e' || c == 'E')
						return res * Math.pow(10, nextInt());
					if (c < '0' || c > '9')
						throw new InputMismatchException();
					m /= 10;
					res += (c - '0') * m;
					c = read();
				}
			}
			return res * sgn;
		}

		public String readString()
		{
			int c = read();
			while (isSpaceChar(c))
				c = read();
			StringBuilder res = new StringBuilder();
			do
			{
				res.appendCodePoint(c);
				c = read();
			}
			while (!isSpaceChar(c));

			return res.toString();
		}

		public boolean isSpaceChar(int c)
		{
			if (filter != null)
				return filter.isSpaceChar(c);
			return c == ' ' || c == '\n' || c == '\r' || c == '\t' || c == -1;
		}

		public String next()
		{
			return readString();
		}

		public interface SpaceCharFilter
		{
			public boolean isSpaceChar(int ch);
		}
	}

	public static void main(String args[]) throws Exception
	{
		new Thread(null, new Solution1(),"Solution1",1<<26).start();
	}
	public static int gcd(int a, int b)
    {
        if (a == 0)
            return b;

        return gcd(b%a, a);
    }

	  static int lcm(int a, int b)
	    {
	        return (a*b)/gcd(a, b);
	    }
	static int max=  -1;
	public void run()
	{
		InputReader sc= new InputReader(System.in);
		PrintWriter w= new PrintWriter(System.out);
		int n = sc.nextInt();
		int r = sc.nextInt();
		int[] arr=  new int[n];
		for(int i = 0;i < n;i++){
			arr[i] = sc.nextInt();
		}
		double sqr = 2*r*2*r;
		double[] ans=  new double[n];
		for(int i = 0;i < arr.length;i++){
			ans[i] = r*1.0;
			for(int j = 0;j < i;j++){
				if(Math.abs(arr[i] - arr[j]) < 2*r){
					ans[i] = Math.max(ans[i],Math.sqrt(sqr - Math.abs(arr[i] - arr[j])*Math.abs(arr[i]-arr[j])) + ans[j]);
				}else if(Math.abs(arr[i]-arr[j]) == 2*r){
					ans[i] = Math.max(ans[i],ans[j]);
				}
			}
		}
		for(int i = 0;i < ans.length;i++){
			System.out.printf("%.7f ",ans[i]);
		}
		w.close();
	}

}


import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.Arrays;
import java.io.IOException;
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.io.InputStream;

/**
 * Built using CHelper plug-in
 * Actual solution is at the top
 */
public class Main {
    public static void main(String[] args) {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        InputScanner in = new InputScanner(inputStream);
        PrintWriter out = new PrintWriter(outputStream);
        TaskC solver = new TaskC();
        solver.solve(1, in, out);
        out.close();
    }

    static class TaskC {
        public void solve(int testNumber, InputScanner in, PrintWriter out) {
            int[] arr = in.readIntArr();
            int n = arr[0];
            int r = arr[1];

            int[] x = in.readIntArr();
            for (int i = 0; i < n; i++) {
                x[i] += 999;
            }

            double[] h = new double[n];
            int dsk[] = new int[3000];
            Arrays.fill(dsk, -1);

            for (int i = 0; i < r; i++) {
                dsk[x[0] + i] = 0;
                dsk[x[0] - i - 1] = 0;
            }
            int rs = 4 * r * r;

            h[0] = r;

            for (int i = 1; i < n; i++) {
                double ch = r;
                for (int j = 0; j < r; j++) {

                    if (dsk[x[i] + j] != -1) {
                        int ind = dsk[x[i] + j];
                        int diff = x[ind] - x[i];
                        int diffs = diff * diff;
                        int hs = rs - diffs;
                        ch = Math.max(ch, h[ind] + Math.sqrt(hs));
                    }

                    if (dsk[x[i] - j - 1] != -1) {
                        int ind = dsk[x[i] - j - 1];
                        int diff = x[ind] - x[i];
                        int diffs = diff * diff;
                        int hs = rs - diffs;
                        ch = Math.max(ch, h[ind] + Math.sqrt(hs));
                    }

                }
                if (x[i] + r < 3000) {
                    if (dsk[x[i] + r] != -1) {
                        ch = Math.max(ch, h[dsk[x[i] + r]]);
                    }
                }
                if (x[i] - r - 1 > 0) {
                    if (dsk[x[i] - r - 1] != -1) {
                        ch = Math.max(ch, h[dsk[x[i] - r - 1]]);
                    }
                }
                for (int j = 0; j < r; j++) {
                    dsk[x[i] + j] = i;
                    dsk[x[i] - j - 1] = i;
                }
                h[i] = ch;

            }

            for (int i = 0; i < n; i++) {
                out.print(h[i] + " ");
            }
            out.println();

        }

    }

    static class InputScanner {
        BufferedReader br;

        public InputScanner(InputStream is) {
            br = new BufferedReader(new InputStreamReader(is));

        }

        String readLine() {
            String line = null;
            try {
                line = br.readLine();
            } catch (IOException e) {
                e.printStackTrace();
            }
            return line;

        }

        public String[] readStringArr() {

            return readLine().split(" ");

        }

        public int[] readIntArr() {
            String[] str = readStringArr();
            int arr[] = new int[str.length];
            for (int i = 0; i < arr.length; i++)
                arr[i] = Integer.parseInt(str[i]);
            return arr;
        }

    }
}


import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.util.ArrayList;
import java.util.StringTokenizer;

public class C {

	private static double r, EPS=1e-10;

	public static void solve(FastScanner fs) {
		int n=fs.nextInt();
		r=fs.nextInt();
		int[] xCoords=fs.readArray(n);

		ArrayList<Point> placed=new ArrayList<>();
		for (int x:xCoords) {
			double maxY=r;
			for (Point p:placed)
				maxY=Math.max(maxY, getNewY(p, x));
			placed.add(new Point(x, maxY));
		}
		for (Point p:placed) {
			System.out.printf("%.9f ", p.y);
		}

	}

	private static double getNewY(Point circleCenter, int x) {
		double dx=Math.abs(x-circleCenter.x);
		if (dx>r+r)
			return 0;
		if (dx<EPS)
			return circleCenter.y+r+r;
		double hypot=r+r;
		return circleCenter.y+Math.sqrt(hypot*hypot-(double)dx*dx);
	}

	static class Point {
		double x;
		double y;
		public Point(double x, double y) {
			this.x=x;
			this.y=y;
		}
 	}

	public static void main(String[] args) throws NumberFormatException, IOException {
		FastScanner scanner = new FastScanner(System.in);
		solve(scanner);
	}

	private static class FastScanner {
		BufferedReader br;
		StringTokenizer st;
		public FastScanner(InputStream in) {
			br = new BufferedReader(new InputStreamReader(in));
		}
		String next() {
			while (st == null || !st.hasMoreElements()) {
				try {
					st = new StringTokenizer(br.readLine());
				} catch (IOException e) {
					e.printStackTrace();
				}
			}
			return st.nextToken();
		}
		int nextInt() {
			return Integer.parseInt(next());
		}
		long nextLong() {
			return Long.parseLong(next());
		}
		double nextDouble() {
			return Double.parseDouble(next());
		}
		String nextLine() {
			String str = "";
			try {
				str = br.readLine();
			} catch (IOException e) {
				e.printStackTrace();
			}
			return str;
		}
		int[] readArray(int n) {
			int[] a=new int[n];
			for (int i=0; i<n; i++)
				a[i]=nextInt();
			return a;
		}
		long[] readLongArray(int n) {
			long[] a=new long[n];
			for (int i=0; i<n; i++)
				a[i]=nextLong();
			return a;
		}
	}
}


import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.io.PrintStream;
import java.util.StringTokenizer;
import java.io.IOException;
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.io.InputStream;

/**
 * Built using CHelper plug-in
 * Actual solution is at the top
 *
 * @author Wolfgang Beyer
 */
public class Main {
    public static void main(String[] args) {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        InputReader in = new InputReader(inputStream);
        PrintWriter out = new PrintWriter(outputStream);
        TaskC solver = new TaskC();
        solver.solve(1, in, out);
        out.close();
    }

    static class TaskC {
        public void solve(int testNumber, InputReader in, PrintWriter out) {
            int n = in.nextInt();
            int r = in.nextInt();
            int[] x = in.readIntArray(n);
            double[] y = new double[n];
            for (int i = 0; i < n; i++) {
                y[i] = r;
                for (int j = 0; j < i; j++) {
                    double d = Math.abs(x[j] - x[i]);
                    if (d <= 2 * r) {
                        double yy = Math.sqrt(4.0 * r * r - d * d);
                        y[i] = Math.max(y[i], y[j] + yy);
                    }
                }
            }
            for (int i = 0; i < n; i++) {
                out.print(y[i] + " ");
            }
        }

    }

    static class InputReader {
        private static BufferedReader in;
        private static StringTokenizer tok;

        public InputReader(InputStream in) {
            this.in = new BufferedReader(new InputStreamReader(in));
        }

        public int nextInt() {
            return Integer.parseInt(next());
        }

        public int[] readIntArray(int n) {
            int[] ar = new int[n];
            for (int i = 0; i < n; i++) {
                ar[i] = nextInt();
            }
            return ar;
        }

        public String next() {
            try {
                while (tok == null || !tok.hasMoreTokens()) {
                    tok = new StringTokenizer(in.readLine());
                    //tok = new StringTokenizer(in.readLine(), ", \t\n\r\f"); //adds commas as delimeter
                }
            } catch (IOException ex) {
                System.err.println("An IOException was caught :" + ex.getMessage());
            }
            return tok.nextToken();
        }

    }
}


import java.util.*;
import java.lang.*;
import java.io.*;
import java.math.*;
/* Name of the class has to be "Main" only if the class is public. */
public class Codechef
{
    static BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
	static ArrayList<ArrayList<Integer>> list;
    static HashSet<Integer> hs;
    static ArrayList<Integer> tmp;
    //int n=Integer.parseInt(br.readLine());
    //int n=Integer.parseInt(st.nextToken());
    //StringTokenizer st = new StringTokenizer(br.readLine());
    public static double cal(int a,double b,int x,int r)
    {
        r*=2;
        double dis=(r*r) - Math.pow(Math.abs(a-x),2);

        dis=Math.sqrt(dis);

        dis+=b;

        return dis;

    }
	public static void main (String[] args) throws java.lang.Exception
	{
	    int n,r;
	    StringTokenizer st = new StringTokenizer(br.readLine());
	    n=Integer.parseInt(st.nextToken());
	    r=Integer.parseInt(st.nextToken());

	    int arr[] = new int[n+1];
	    double cen[] = new double[n+1];

	    int i,j;

	    for(i=1;i<=n;i++)
	    cen[i]=-1.0;

	    st = new StringTokenizer(br.readLine());
	    for(i=1;i<=n;i++)arr[i]=Integer.parseInt(st.nextToken());

	    for(i=1;i<=n;i++)
	    {
	        int f=0;
	        double max=-1.0;
	        for(j=1;j<=n;j++)
	        {
	            if(i!=j && cen[j]!=-1.0 && (Math.abs(arr[i]-arr[j])<=2*r))
	            {
	                max=Math.max(max,cal(arr[j],cen[j],arr[i],r));
	                f=1;

	            }
	        }
	       // System.out.println(i+" "+max);
	        if(f==1)
	        cen[i]=max;
	        else
	        cen[i]=r*1.0;
	    }
	    for(i=1;i<=n;i++)
	    System.out.print(cen[i]+" ");
	}
}


import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.io.OutputStream;
import java.io.InputStreamReader;
import java.io.FileNotFoundException;
import java.io.File;
import java.util.StringTokenizer;
import java.io.Writer;
import java.io.BufferedReader;
import java.io.UnsupportedEncodingException;
import java.io.InputStream;

/**
 * Built using CHelper plug-in
 * Actual solution is at the top
 *
 * @author MaxHeap
 */
public class Main {
    public static void main(String[] args) {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        FastReader in = new FastReader(inputStream);
        OutputWriter out = new OutputWriter(outputStream);
        TaskC solver = new TaskC();
        solver.solve(1, in, out);
        out.close();
    }

    static class TaskC {
        public void solve(int testNumber, FastReader in, OutputWriter out) {
            int n = in.nextInt();
            double r = in.nextInt();
            double[] x = new double[n];
            for (int i = 0; i < n; i++) {
                x[i] = in.nextDouble();
            }
            double[] ans = new double[n];
            ans[0] = r;
            for (int i = 1; i < n; i++) {
                ans[i] = r;
                double maxY = 0;
                for (int j = 0; j < i; j++) {
                    if (Math.abs(x[j] - x[i]) <= 2.0 * r) {
                        double y = ans[j] + Math.sqrt(4 * r * r - (x[j] - x[i]) * (x[j] - x[i]));
                        ans[i] = Math.max(ans[i], y);
                    }
                }
            }
            for (int i = 0; i < n; i++) {
                if (i > 0) out.print(" ");
                out.printf("%.8f", ans[i]);
            }
        }

    }

    static class FastReader {
        BufferedReader reader;
        StringTokenizer st;

        public FastReader(InputStream stream) {
            reader = new BufferedReader(new InputStreamReader(stream));
            st = null;
        }

        public String next() {
            while (st == null || !st.hasMoreTokens()) {
                try {
                    String line = reader.readLine();
                    if (line == null) {
                        return null;
                    }
                    st = new StringTokenizer(line);
                } catch (Exception e) {
                    throw new RuntimeException();
                }
            }
            return st.nextToken();
        }

        public int nextInt() {
            return Integer.parseInt(next());
        }

        public double nextDouble() {
            return Double.parseDouble(next());
        }

    }

    static class OutputWriter extends PrintWriter {
        public OutputWriter(OutputStream os, boolean autoFlush) {
            super(os, autoFlush);
        }

        public OutputWriter(Writer out) {
            super(out);
        }

        public OutputWriter(Writer out, boolean autoFlush) {
            super(out, autoFlush);
        }

        public OutputWriter(String fileName) throws FileNotFoundException {
            super(fileName);
        }

        public OutputWriter(String fileName, String csn) throws FileNotFoundException, UnsupportedEncodingException {
            super(fileName, csn);
        }

        public OutputWriter(File file) throws FileNotFoundException {
            super(file);
        }

        public OutputWriter(File file, String csn) throws FileNotFoundException, UnsupportedEncodingException {
            super(file, csn);
        }

        public OutputWriter(OutputStream out) {
            super(out);
        }

        public void flush() {
            super.flush();
        }

        public void close() {
            super.close();
        }

    }
}


/*
ID: andrew42
LANG: JAVA
TASK:
PROG:
*/

import java.io.*;
import java.util.*;
import java.lang.*;

public class curling {
	public static void main(String[] args) throws IOException {
		Scanner input = new Scanner(System.in);
		int numD = input.nextInt();
		double rad = input.nextInt();
		int[] xC = new int[numD];
		for (int i = 0; i < numD; i++){
			xC[i] = input.nextInt();
		}
		double[] maxY = new double[1001];
		for (int i = 0; i < numD; i++){
			double h = rad;
			for (int j = Math.max(1, xC[i]-(int)(2*rad)); j <= Math.min(1000, xC[i]+2*rad); j++){
				if (maxY[j] > 0){
					h = Math.max(h, Math.sqrt(4*rad*rad-(j-xC[i])*(j-xC[i]))+maxY[j]);
				}
			}
			System.out.print(h + " ");
			maxY[xC[i]] = h;
		}
	}
}


import java.io.*;
import java.util.StringTokenizer;

public class Main {
    static double [] res;
    static double r;
    static double solve (int xMe, int xHim, int idxHim) {
        if (Math.abs(xMe - xHim) > 2 * r) return r;
        double hisY = res[idxHim];
        double lo = hisY, hi = hisY + 2 * r, best = hi;
        for (int cnt = 0; cnt <= 50; cnt++) {
            double myY = (lo) + ((hi - lo) / 2);
            if (notIntersect(xMe, myY, xHim, hisY)) {
                best = Math.min(best, myY);
                hi = Math.max(lo, myY);
            } else
                lo = Math.min(hi, myY);
        }
        return best;
    }
    static boolean notIntersect (double x1, double y1, double x2, double y2) {
        return (x1 - x2) * (x1 - x2) + (y1 - y2) * (y1 - y2) >= 2 * r  * 2 * r;
    }
    public static void main(String[] args) throws Exception {
        Scanner sc = new Scanner(System.in);
        PrintWriter out = new PrintWriter(System.out);
        int n = sc.nextInt();
        res = new double[n];
        r = sc.nextInt();
        int[] x = new int[n];
        for (int i = 0; i < n; i++)
            x[i] = sc.nextInt();

        for (int i = 0; i < n; i++) {
            double max = r;
            for (int j = 0; j < i; j++) {
                max = Math.max(max, solve(x[i], x[j], j));
            }
            if (i > 0) out.print(" ");
            res[i] = max;
            out.printf("%.10f", max);
        }
        out.println();

        out.flush();
        out.close();
    }
    static class Scanner {
        StringTokenizer st;
        BufferedReader br;

        public Scanner(InputStream s){	br = new BufferedReader(new InputStreamReader(s));}

        public Scanner(FileReader s) throws FileNotFoundException {	br = new BufferedReader(s);}

        public String next() throws IOException
        {
            while (st == null || !st.hasMoreTokens())
                st = new StringTokenizer(br.readLine());
            return st.nextToken();
        }

        public int nextInt() throws IOException {return Integer.parseInt(next());}

        public long nextLong() throws IOException {return Long.parseLong(next());}

        public String nextLine() throws IOException {return br.readLine();}

        public double nextDouble() throws IOException { return Double.parseDouble(next()); }

        public boolean ready() throws IOException {return br.ready();}
    }
}


import java.util.*;
import java.io.*;
public class probC {
	static int r;
	static ArrayList<Circ> curr = new ArrayList<Circ>();
	public static void main(String[] args) throws IOException {
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		r = sc.nextInt();
		int[] xC = new int[n];
		for(int i = 0; i < n; i++)
			xC[i] = sc.nextInt();
		double ans[] = new double[n];
		ans[0] = r;
		curr.add(new Circ(xC[0], r));
		for(int i = 1; i < n; i++) {
			double max = r;
			for(int k = 0; k < curr.size(); k++) {
				double cur = curr.get(k).y+ Math.sqrt(4 * r*r - (xC[i]-curr.get(k).x)*(xC[i]-curr.get(k).x));
				//System.out.println(cur + " " + max);
				if(4 * r*r - (xC[i]-curr.get(k).x)*(xC[i]-curr.get(k).x) >= 0)
					max = Math.max(cur,  max);
			}
			ans[i] = max;
			curr.add(new Circ(xC[i], max));
			//System.out.println();
		}
		for(int i = 0; i < n; i++)
			System.out.print(ans[i] + " ");
		sc.close();
	}
	static class Circ {
		double x, y;
		public Circ(double a, double b) {
			x=a;
			y=b;
		}
		public boolean isNT(Circ b) {
			double dist = Math.sqrt((x-b.x)*(x-b.x)+(y-b.y)*(y-b.y));
			return dist > 2*r;
		}
	}
}


//>>>BaZ<<<//
import java.util.*;
import java.io.*;
import static java.lang.Math.*;
public class Main
{
    static int dx[] = {-1,1,0,0};
    static int dy[] = {0,0,1,-1};
    static long MOD = 1000000007;
    static int INF = Integer.MAX_VALUE/10;
    static PrintWriter pw;
    static InputReader scan;
    //static MyFileReader1 ss;
    //static MyFileReader scan;
    static int ni() throws IOException{return scan.nextInt();}
    static long nl() throws IOException{return scan.nextLong();}
    static double nd() throws IOException{return scan.nextDouble();}
    static String ne() throws IOException{return scan.next();}
    static void pl() throws IOException {pw.println();}
    static void pl(Object o) throws IOException {pw.println(o);}
    static void p(Object o) throws IOException {pw.print(o+" ");}
    static void psb(StringBuilder sb) throws IOException {pw.print(sb);}
    public static void main(String[] args) {
        new Thread(null,null,"BaZ",99999999)
        {
            public void run()
            {
                try
                {
                    solve();
                }
                catch(Exception e)
                {
                    e.printStackTrace();
                    System.exit(1);
                }
            }
        }.start();
    }
    static void solve() throws IOException
    {
        Calendar CAL1 = Calendar.getInstance();
        CAL1.setTime(new Date());
        scan = new InputReader(System.in);
        pw = new PrintWriter(System.out,true);
        //pw = new PrintWriter(new File("C://Users/Aman deep/Desktop/output.txt"));
        //ss = new MyFileReader1();
        //scan = new MyFileReader();
        StringBuilder sb = new StringBuilder();
        int n = ni();
        double r = ni();
        double x[] = new double[n];
        for(int i=0;i<n;++i)
            x[i] = nd();
        double y[] = new double[n];
        y[0] = r;
        for(int i=1;i<n;++i)
        {
            double max = -1;
            for(int j=0;j<i;++j)
            {
                double xx = 4*r*r-(x[i]-x[j])*(x[i]-x[j]);
                if(xx>=0)
                    max = max(max,sqrt(xx)+y[j]);
            }
            if(max==-1)
                max = r;
            y[i] = max;
        }
        for(int i=0;i<n;++i)
            p(y[i]);
        pl();
        Calendar CAL2 = Calendar.getInstance();
        CAL2.setTime(new Date());
        double Execution_Time = (double)(CAL2.getTimeInMillis()-CAL1.getTimeInMillis())/1000.000;
        //System.out.println("Execution time : "+Execution_Time+" seconds");
        pw.flush();
        pw.close();
    }
    static class InputReader     //NoSuchElementException -> EOF
	{
		private InputStream stream;
		private byte[] buf = new byte[1024];
		private int curChar;
		private int numChars;
		private SpaceCharFilter filter;

		public InputReader(InputStream stream)
		{
			this.stream = stream;
		}

		public int read()
		{
			if (numChars==-1)
				throw new InputMismatchException();

			if (curChar >= numChars)
			{
				curChar = 0;
				try
				{
					numChars = stream.read(buf);
				}
				catch (IOException e)
				{
					throw new InputMismatchException();
				}

				if(numChars <= 0)
					return -1;
			}
			return buf[curChar++];
		}

		public String nextLine()
		{
			BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
			String str = "";
            try
            {
                str = br.readLine();
            }
            catch (IOException e)
            {
                e.printStackTrace();
            }
            return str;
		}
		public int nextInt()
		{
			int c = read();

			while(isSpaceChar(c))
				c = read();

			int sgn = 1;

			if (c == '-')
			{
				sgn = -1;
				c = read();
			}

			int res = 0;
			do
			{
				if(c<'0'||c>'9')
					throw new InputMismatchException();
				res *= 10;
				res += c - '0';
				c = read();
			}
			while (!isSpaceChar(c));

			return res * sgn;
		}

		public long nextLong()
		{
			int c = read();
			while (isSpaceChar(c))
				c = read();
			int sgn = 1;
			if (c == '-')
			{
				sgn = -1;
				c = read();
			}
			long res = 0;

			do
			{
				if (c < '0' || c > '9')
					throw new InputMismatchException();
				res *= 10;
				res += c - '0';
				c = read();
			}
			while (!isSpaceChar(c));
				return res * sgn;
		}

		public double nextDouble()
		{
			int c = read();
			while (isSpaceChar(c))
				c = read();
			int sgn = 1;
			if (c == '-')
			{
				sgn = -1;
				c = read();
			}
			double res = 0;
			while (!isSpaceChar(c) && c != '.')
			{
				if (c == 'e' || c == 'E')
					return res * Math.pow(10, nextInt());
				if (c < '0' || c > '9')
					throw new InputMismatchException();
				res *= 10;
				res += c - '0';
				c = read();
			}
			if (c == '.')
			{
				c = read();
				double m = 1;
				while (!isSpaceChar(c))
				{
					if (c == 'e' || c == 'E')
						return res * Math.pow(10, nextInt());
					if (c < '0' || c > '9')
						throw new InputMismatchException();
					m /= 10;
					res += (c - '0') * m;
					c = read();
				}
			}
			return res * sgn;
		}

		public String readString()
		{
			int c = read();
			while (isSpaceChar(c))
				c = read();
			StringBuilder res = new StringBuilder();
			do
			{
				res.appendCodePoint(c);
				c = read();
			}
			while (!isSpaceChar(c));

			return res.toString();
		}

		public boolean isSpaceChar(int c)
		{
			if (filter != null)
				return filter.isSpaceChar(c);
			return c == ' ' || c == '\n' || c == '\r' || c == '\t' || c == -1;
		}

		public String next()
		{
			return readString();
		}

		public interface SpaceCharFilter
		{
			public boolean isSpaceChar(int ch);
		}
	}
    static class MyFileReader                                          //File input template
    {
        StringTokenizer st;
        BufferedReader br;
        MyFileReader() throws IOException
        {
            br = new BufferedReader(new FileReader("C://Users/Aman deep/Desktop/input.txt"));
        }
        String nextLine() throws IOException
        {
            return br.readLine();
        }
        String next() throws IOException
        {
            if(st==null || !st.hasMoreTokens())
                st = new StringTokenizer(nextLine());
            return st.nextToken();
        }
        int nextInt() throws IOException
        {
            return Integer.parseInt(next());
        }
        long nextLong() throws IOException
        {
            return Long.parseLong(next());
        }
        double nextDouble() throws IOException
        {
            return Double.parseDouble(next());
        }
    }
    static class MyFileReader1                                          //File input template
    {
        StringTokenizer st;
        BufferedReader br;
        MyFileReader1() throws IOException
        {
            br = new BufferedReader(new FileReader("C://Users/Aman deep/Desktop/output.txt"));
        }
        String nextLine() throws IOException
        {
            return br.readLine();
        }
        String next() throws IOException
        {
            if(st==null || !st.hasMoreTokens())
                st = new StringTokenizer(nextLine());
            return st.nextToken();
        }
        int nextInt() throws IOException
        {
            return Integer.parseInt(next());
        }
        long nextLong() throws IOException
        {
            return Long.parseLong(next());
        }
        double nextDouble() throws IOException
        {
            return Double.parseDouble(next());
        }
    }
}


import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.util.Scanner;
import java.util.*;

public class Main {

    public static void main(String[] args) throws IOException{
        Scanner sc = new Scanner();
        PrintWriter out = new PrintWriter(System.out);

        int N = sc.nextInt(), R = sc.nextInt();
        double answer[] = new double[N];
        int[] x = new int[N];

        for (int i = 0; i < N; i++)
            x[i] = sc.nextInt();

        for (int i = 0; i < N; i++) {
            answer[i] = R;
            for (int j = 0; j < i; j++) {
                int dist = Math.abs(x[i] - x[j]);
                if(dist <= 2 * R) {
                    double t = answer[j] + Math.sqrt(4 * R * R - dist * dist);
                    answer[i] = Math.max(answer[i], t);
                }
            }
        }
        for(int i = 0; i < N; ++i)
            out.print(answer[i] + " ");

        out.println();

        out.flush();
        out.close();
    }

    static class Scanner {
        BufferedReader br;
        StringTokenizer st;

        Scanner() {
            br = new BufferedReader(new InputStreamReader(System.in));
        }

        String next() throws IOException {
            while (st == null || !st.hasMoreTokens()) {
                st = new StringTokenizer(br.readLine());
            }
            return st.nextToken();
        }

        int nextInt() throws IOException {
            return Integer.parseInt(next());
        }

        long nextLong() throws IOException {
            return Long.parseLong(next());
        }

        double nextDouble() throws IOException {
            return Double.parseDouble(next());
        }

        String nextLine() throws IOException {
            return br.readLine();
        }

    }
    }


import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.util.StringTokenizer;

/**
 * Created by mostafa on 12/29/17.
 */
public class C {
    public static void main(String[] args) throws IOException {
        Scanner sc = new Scanner();
        PrintWriter out = new PrintWriter(System.out);
        int n = sc.nextInt(), r = sc.nextInt();
        int[] x = new int[n];
        for(int i = 0; i < n; i++)
            x[i] = sc.nextInt();
        double[] ans = new double[n];
        for(int i = 0; i < n; i++) {
            ans[i] = r;
            for(int j = 0; j < i; j++) {
                int d = Math.abs(x[i] - x[j]);
                if(d > 2 * r)
                    continue;
                int h = 2 * r;
                double yd = Math.sqrt(h * h - d * d);
                ans[i] = Math.max(ans[i], ans[j] + yd);
            }

            out.print(ans[i]);
            if(i == n - 1)
                out.println();
            else
                out.print(" ");
        }

        out.flush();
        out.close();

    }

    static class Scanner {
        BufferedReader br; StringTokenizer st;
        Scanner() {
            br = new BufferedReader(new InputStreamReader(System.in));
        }

        String next() throws IOException {
            while(st == null || !st.hasMoreTokens())
                st = new StringTokenizer(br.readLine());
            return st.nextToken();
        }

        int nextInt() throws IOException {
            return Integer.parseInt(next());
        }

    }
}


import java.util.*;
import java.io.*;
import java.math.*;
public class A{

    void solve(){
        int n=ni();
        long r=ni();
        int x[]=new int[n+1];
        for(int i=1;i<=n;i++) x[i]=ni();

        double ans[]=new double[n+1];
        ans[1]=r;
        for(int i=2;i<=n;i++){
            double mx=0;
            for(int j=1;j<i;j++) {
                double xx = Math.abs(x[i] - x[j]);
                if (xx > 2*r) {
                    mx = Math.max(mx,r);
                } else {
                    xx *= xx;
                     mx=Math.max(mx,ans[j] + Math.sqrt(4 * r * r - xx));
                    // if(i==5) pw.println(j);
                }
                //if(i==4) pw.println(mx);
            }
            ans[i]=mx;
        }
        for(int i=1;i<=n;i++) pw.print(ans[i]+" ");
    }

    long M=(long)1e9+7;
    InputStream is;
    PrintWriter pw;
    String INPUT = "";
    void run() throws Exception {
        is = INPUT.isEmpty() ? System.in : new ByteArrayInputStream(INPUT.getBytes());
        pw = new PrintWriter(System.out);
        long s = System.currentTimeMillis();
        solve();
        pw.flush();
        if(!INPUT.isEmpty())tr(System.currentTimeMillis()-s+"ms");
    }

    public static void main(String[] args) throws Exception { new A().run(); }

    private byte[] inbuf = new byte[1024];
    public int lenbuf = 0, ptrbuf = 0;

    private int readByte() {
        if(lenbuf == -1)throw new InputMismatchException();
        if(ptrbuf >= lenbuf){
            ptrbuf = 0;
            try { lenbuf = is.read(inbuf); } catch (IOException e) { throw new InputMismatchException(); }
            if(lenbuf <= 0)return -1;
        }
        return inbuf[ptrbuf++];
    }

    private boolean isSpaceChar(int c) { return !(c >= 33 && c <= 126); }
    private int skip() { int b; while((b = readByte()) != -1 && isSpaceChar(b)); return b; }

    private double nd() { return Double.parseDouble(ns()); }
    private char nc() { return (char)skip(); }

    private String ns() {
        int b = skip();
        StringBuilder sb = new StringBuilder();
        while(!(isSpaceChar(b))){ // when nextLine, (isSpaceChar(b) && b != ' ')
            sb.appendCodePoint(b);
            b = readByte();
        }
        return sb.toString();
    }

    private char[] ns(int n) {
        char[] buf = new char[n];
        int b = skip(), p = 0;
        while(p < n && !(isSpaceChar(b))){
            buf[p++] = (char)b;
            b = readByte();
        }
        return n == p ? buf : Arrays.copyOf(buf, p);
    }

    private char[][] nm(int n, int m) {
        char[][] map = new char[n][];
        for(int i = 0;i < n;i++)map[i] = ns(m);
        return map;
    }

    private int[] na(int n) {
        int[] a = new int[n];
        for(int i = 0;i < n;i++)a[i] = ni();
        return a;
    }

    private int ni() {
        int num = 0, b;
        boolean minus = false;
        while((b = readByte()) != -1 && !((b >= '0' && b <= '9') || b == '-'));
        if(b == '-'){
            minus = true;
            b = readByte();
        }

        while(true){
            if(b >= '0' && b <= '9'){
                num = num * 10 + (b - '0');
            }else{
                return minus ? -num : num;
            }
            b = readByte();
        }
    }

    private long nl() {
        long num = 0;
        int b;
        boolean minus = false;
        while((b = readByte()) != -1 && !((b >= '0' && b <= '9') || b == '-'));
        if(b == '-'){
            minus = true;
            b = readByte();
        }

        while(true){
            if(b >= '0' && b <= '9'){
                num = num * 10 + (b - '0');
            }else{
                return minus ? -num : num;
            }
            b = readByte();
        }
    }

    private void tr(Object... o) { if(INPUT.length() > 0)System.out.println(Arrays.deepToString(o)); }
}


import static java.lang.Integer.parseInt;
import static java.lang.Long.parseLong;
import static java.lang.Math.abs;
import static java.lang.Math.max;
import static java.lang.Math.sqrt;
import static java.lang.System.exit;

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.util.Locale;
import java.util.StringTokenizer;

public class C {

	static int sqr(int x) {
		return x * x;
	}

	static void solve() throws Exception {
		int n = scanInt();
		int r = scanInt();
		int x[] = new int[n];
		double y[] = new double[n];
		for (int i = 0; i < n; i++) {
			int cx = x[i] = scanInt();
			double cy = r;
			for (int j = 0; j < i; j++) {
				if (abs(cx - x[j]) <= 2 * r) {
					cy = max(cy, y[j] + sqrt(sqr(2 * r) - sqr(cx - x[j])));
				}
			}
			y[i] = cy;
			if (i > 0) {
				out.print(' ');
			}
			out.printf(Locale.US, "%.9f", cy);
		}
	}

	static int scanInt() throws IOException {
		return parseInt(scanString());
	}

	static long scanLong() throws IOException {
		return parseLong(scanString());
	}

	static String scanString() throws IOException {
		while (tok == null || !tok.hasMoreTokens()) {
			tok = new StringTokenizer(in.readLine());
		}
		return tok.nextToken();
	}

	static BufferedReader in;
	static PrintWriter out;
	static StringTokenizer tok;

	public static void main(String[] args) {
		try {
			in = new BufferedReader(new InputStreamReader(System.in));
			out = new PrintWriter(System.out);
			solve();
			in.close();
			out.close();
		} catch (Throwable e) {
			e.printStackTrace();
			exit(1);
		}
	}
}


import java.util.Scanner;

public class TaskC {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt(), r = sc.nextInt();
		int[] xcords = new int[n];
		double[] ycords = new double[n];
		double y = r, x = 0, px = 0, ty = 0;
		for(int i = 0; i < n; i++) {
			xcords[i] = sc.nextInt();
			x = xcords[i];
			y = r;
			for(int j = 0; j < i; j++) {
				px = xcords[j];
				if(Math.abs(px - x) > r*2) continue;
				ty = Math.sqrt(4*r*r - (x-px)*(x-px)) + ycords[j];
				y = Math.max(y, ty);
			}
			ycords[i] = y;
		}
		for(int i = 0; i < n; i++) {
			System.out.print(ycords[i] + " ");
		}
	}

}


import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashMap;
import java.util.HashSet;
import java.util.StringTokenizer;

public class C {
	public static void main(String[] args) throws IOException {
		FastScanner in= new FastScanner(System.in);
		PrintWriter out= new PrintWriter(System.out);

		int n= in.nextInt();
		int r= in.nextInt();
		int [] x= new int[n];
		for (int i = 0; i < x.length; i++) {
			x[i]= in.nextInt();
		}
		double [] res= new double[n];
		res[0]= r;
		for (int i = 1; i < x.length; i++) {
			boolean found = false;
			for (int j = 0; j < i; j++) {
				double dis= Math.abs(x[i]-x[j]);
				double rr= 4.0*r*r-1.0*dis*dis;
				if(rr>=0) {
					double del= Math.sqrt(rr);
					res[i]= Math.max(res[i], res[j]+del);
					found= true;
				}
			}
			if(!found) {
				res[i]= r;
			}
		}
		for (int i = 0; i < res.length; i++) {
			out.print(res[i]+" ");
		}
		out.close();

	}
	static class FastScanner {
		BufferedReader br;
		StringTokenizer st;

		public FastScanner(InputStream in) {
			br = new BufferedReader(new InputStreamReader(in));
			st = new StringTokenizer("");
		}

		public String next() throws IOException {
			if (!st.hasMoreTokens()) {
				st = new StringTokenizer(br.readLine());
				return next();
			}
			return st.nextToken();
		}

		public int nextInt() throws IOException {
			return Integer.parseInt(next());
		}
		public double nextDouble() throws NumberFormatException, IOException {
			return Double.parseDouble(next());
		}
		public long nextLong() throws IOException {
			return Long.parseLong(next());
		}
	}
}


import java.util.ArrayList;
import java.util.Collections;
import java.util.Scanner;

public class C908 {

	public static class mPoint implements Comparable<mPoint> {
		public double a, b;
		public mPoint(int a, double b) {
			this.a = a; this.b = b;
		}
		public int compareTo(mPoint p) {
			return b < p.b ? 1 : (b > p.b) ? -1 : 0;
		}
	}

	public static void main(String[] args) {
		Scanner in = new Scanner(System.in);
		int n = in.nextInt(), r = in.nextInt();
		int[] ar = new int[n];
		ArrayList<mPoint> disks = new ArrayList<>();
		double[] ans = new double[n];
		for (int i = 0; i < n; i++) {
			ar[i] = in.nextInt();
			double max = -1;
			for (int j = 0; j < disks.size(); j++) {
				if (inRange(ar[i], disks.get(j).a, r)) {
					double h = 4*r*r - (ar[i]-disks.get(j).a) * (ar[i]-disks.get(j).a);
					max = Math.max(max, Math.sqrt(h) + disks.get(j).b);
				}
			}
			mPoint p = null;
			if (max == -1) {
				p = new mPoint(ar[i], r);
			} else {
				p = new mPoint(ar[i], max);
			}
			disks.add(p);
			ans[i] = p.b;
		}
		for (int i = 0; i < ans.length - 1; i++) {
			System.out.print(ans[i] + " ");
		}
		System.out.println(ans[ans.length - 1]);
	}

	public static boolean inRange(int a, double b, int r) {
		if (Math.abs(b - a) <= 2*r) return true; return false;
	}

}


import java.io.PrintWriter;
import java.util.Arrays;
import java.util.Scanner;
import java.util.StringTokenizer;

public class C {
	public static Scanner sc = new Scanner(System.in);
	public static StringTokenizer st;
	public static PrintWriter pw = new PrintWriter(System.out);
	final static boolean debugmode = true;
	public static int k = 7; // for 10^9 + k mods.
	public static long STMOD = 1000000000 + k; // 10^9 + k
	public static void main(String[] args) {
		int disks = getInt();
		int radii = getInt();
		if(disks == 1){
			System.out.println(radii);
		}
		else{
			double[][] diskcenters = new double[disks][2];
			for(int i = 0;i<disks;i++){
				diskcenters[i][0] = getInt();
			}
			diskcenters[0][1] = radii;
			for(int i = 1;i<disks;i++){
				double cmax = 0;
				for(int prev = 0;prev < i;prev++){
					cmax = Math.max(cmax, calcintersection(diskcenters[prev][0],diskcenters[prev][1],radii,diskcenters[i][0],radii));
				}
				diskcenters[i][1] = cmax;
			}
			for(int i = 0;i<diskcenters.length;i++){
				System.out.print(Double.toString(diskcenters[i][1]) + " ");
			}
			System.out.print("\n");
		}

	}
	public static double calcintersection(double x1,double y1, double r1,double x2, double r2){
		// x1,y1 must be stationary.
		if(!intersects(x1-r1,x1+r1,x2-r1,x2+r2)){
			return r2;
		}
		else if(x1 == x2){
			return y1 + r1 + r2;
		}
		double lo = y1;
		double hi = y1 +  2 * r2;

		while(Math.abs(lo-hi) > 0.0000001){
			double mid = (lo+hi)/2.0;
			int u = colide(x1,y1,r1,x2,mid,r2);
			if(u == 1){
				lo = mid;
			}
			else if(u == 0)
			{
				hi = mid;
			}
			else{
				return mid;
			}
		}
		return (lo+hi)/2.0;
	}
	public static boolean intersects(double l1, double r1,double l2, double r2 ){
		if(l2  <= l1 && r2 >= l1){
			return true;
		}
		if(l2 <= r1 && r2 >= r1){
			return true;
		}
		if(l1 <= l2 && r2 <= r1){
			return true;
		}
		else if(l2 <= l1 && r1 <= r2){
			return true;
		}
		return false;
	}
	public static int colide(double x1,double y1,double r1,double x2,double y2,double r2){
		double dist = Math.sqrt(Math.pow(x1-x2, 2) + Math.pow(y2-y1, 2));
		if (dist > r1 + r2){
			return 0;
		}
		else if(dist == r1+r2){
			return 2;
		}
		else{
			return 1;
		}

	}
	public static void debug(String toPrint){
		if(!debugmode) {return;}
		pw.println("[DEBUG]: "+toPrint);
	}
	public static void  submit(int[] k){
		pw.println(Arrays.toString(k));
		pw.close();
	}
	public static void submit(int p){
		pw.println(Integer.toString(p));
		pw.close();
	}
	public static void submit(String k){
		pw.println(k);
		pw.close();
	}
	public static void submit(double u){
		pw.println(Double.toString(u));
		pw.close();
	}
	public static void submit(long lng){
		pw.println(Long.toString(lng));
		pw.close();

	}
	public static int getInt(){
		if (st != null && st.hasMoreTokens()){
			return Integer.parseInt(st.nextToken());
		}
		st = new StringTokenizer(sc.nextLine());
		return Integer.parseInt(st.nextToken());
	}
	public static long getLong(){
		if (st != null && st.hasMoreTokens()){
			return Long.parseLong(st.nextToken());
		}
		st = new StringTokenizer(sc.nextLine());
		return Long.parseLong(st.nextToken());
	}
	public static double getDouble(){
		if (st != null && st.hasMoreTokens()){
			return Double.parseDouble(st.nextToken());
		}
		st = new StringTokenizer(sc.nextLine());
		return Double.parseDouble(st.nextToken());
	}
	public static String getString(){
		if(st != null && st.hasMoreTokens()){
			return st.nextToken();
		}
		st = new StringTokenizer(sc.nextLine());
		return st.nextToken();
	}
	public static String getLine(){
		return sc.nextLine();
	}
	public static int[][] readMatrix(int lines,int cols){
		int[][] matrr = new int[lines][cols];
		for (int i = 0;i < lines;i++){
			for(int j = 0;j < cols;j++){
				matrr[i][j] = getInt();
			}
		}
		return matrr;
	}
	public static int[] readArray(int lines){
		int[] ar = new int[lines];
		for (int i = 0;i<lines;i++) ar[i] =getInt();
		return ar;
	}

}


import java.util.*;

public class C {
    public static void main(String[] args) {
        Scanner scan = new Scanner(System.in);

        int n, r;
        n = scan.nextInt();
        r = scan.nextInt();

        int[] locs = new int[n];

        for (int i = 0; i < n; i++) {
            locs[i] = scan.nextInt();
        }

        double[] yPos = new double[n];
        Arrays.fill(yPos, 10e100);

        yPos[0] = r;
        for (int i = 1; i < n; i++) {
            double pos = r;
            for (int j = 0; j < i; j++) {
                int xDist = Math.abs(locs[i] - locs[j]);
                if (xDist <= 2 * r) {
                    double y = (2.0 * r) * (2.0 * r) - (xDist * xDist);
                    if (Math.abs(y - 0.0) < 0.0000000001) {
                        y = 0;
                    } else {
                        y = Math.sqrt(y);
                    }
                    y += yPos[j];
                    pos = Math.max(pos, y);

                } else {
                    continue;
                }
            }
            yPos[i] = pos;
        }
        String[] ans = new String[n];

        for (int i = 0; i < n; i++) {
            ans[i] = "" + yPos[i];
        }

        System.out.println(String.join(" ", ans));

    }
}


import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.util.StringTokenizer;

public class C {
	static int n,r,x[];
	static double ans[];
	public static void main(String args[]) throws IOException
	{
		Scanner sc = new Scanner(System.in);
		PrintWriter pw = new PrintWriter(System.out);
		n = sc.nextInt();
		r = sc.nextInt();
		x = new int[n];
		ans = new double[n];
		for (int i=0;i<n;i++)
			x[i] = sc.nextInt();
		for (int i=0;i<n;i++)
		{
			ans[i] = r;
			for (int j=0;j<i;j++)
			{
				if (Math.abs(x[i]-x[j])>2*r)
					continue;
				int deltaxsq = (x[i]-x[j])*(x[i]-x[j]);
				int deltaysq = 4 * r * r - deltaxsq;
				double deltay = Math.sqrt(deltaysq);
				ans[i] = Math.max(ans[i], ans[j]+deltay);
			}
			pw.print(ans[i]+" ");
		}
		pw.flush();
		pw.close();
	}
	static class Scanner
	{
		StringTokenizer st;
		BufferedReader br;

		public Scanner(InputStream s){	br = new BufferedReader(new InputStreamReader(s));}

		public String next() throws IOException
		{
			while (st == null || !st.hasMoreTokens())
				st = new StringTokenizer(br.readLine());
			return st.nextToken();
		}

		public int nextInt() throws IOException {return Integer.parseInt(next());}

		public long nextLong() throws IOException {return Long.parseLong(next());}

		public String nextLine() throws IOException {return br.readLine();}

		public boolean ready() throws IOException {return br.ready();}

	}
}


import java.io.*;
import java.util.*;

public class Solution {
    static MyScanner sc;
    private static PrintWriter out;
    static long M2 = 1_000_000_000L + 7;

    public static void main(String[] s) throws Exception {
        StringBuilder stringBuilder = new StringBuilder();
        if (stringBuilder.length() == 0) {
            sc = new MyScanner(System.in);
        } else {
            sc = new MyScanner(new BufferedReader(new StringReader(stringBuilder.toString())));
        }

        out = new PrintWriter(new OutputStreamWriter(System.out));
        initData();
        solve();
        out.flush();
    }

    private static void initData() {
    }

    private static void solve() throws IOException {
        int n = sc.nextInt();
        int q = sc.nextInt();
        int[] vv = sc.na(n);

        double[] ans = new double[n];

        for (int i = 0; i < n; i++) {
            ans[i] = q;
            for (int s = 0; s < i; s++) {
                if (Math.abs(vv[i] - vv[s]) > q * 2) continue;
                double diff = 4 * q * q - Math.abs(vv[i] - vv[s]) * Math.abs(vv[i] - vv[s]);
                diff = Math.sqrt(diff);
                ans[i] = Math.max(ans[i], diff + ans[s]);
            }
            out.print(ans[i] + " ");
        }
    }

    private static void solveT() throws IOException {
        int t = sc.nextInt();
        while (t-- > 0) {
            solve();
        }
    }

    private static long gcd(long l, long l1) {
        if (l > l1) return gcd(l1, l);
        if (l == 0) return l1;
        return gcd(l1 % l, l);
    }

    private static long pow(long a, long b, long m) {
        if (b == 0) return 1;
        if (b == 1) return a;
        long pp = pow(a, b / 2, m);
        pp *= pp;
        pp %= m;
        return (pp * (b % 2 == 0 ? 1 : a)) % m;
    }

    static class MyScanner {
        BufferedReader br;
        StringTokenizer st;

        MyScanner(BufferedReader br) {
            this.br = br;
        }

        public MyScanner(InputStream in) {
            this(new BufferedReader(new InputStreamReader(in)));
        }

        void findToken() {
            while (st == null || !st.hasMoreTokens()) {
                try {
                    st = new StringTokenizer(br.readLine());
                } catch (IOException e) {
                    throw new RuntimeException(e);
                }
            }
        }

        String next() {
            findToken();
            return st.nextToken();
        }

        Integer[] nab(int n) {
            Integer[] k = new Integer[n];
            for (int i = 0; i < n; i++) {
                k[i] = sc.fi();
            }
            return k;
        }

        int[] na(int n) {
            int[] k = new int[n];
            for (int i = 0; i < n; i++) {
                k[i] = sc.fi();
            }
            return k;
        }

        long[] nl(int n) {
            long[] k = new long[n];
            for (int i = 0; i < n; i++) {
                k[i] = sc.nextLong();
            }
            return k;
        }

        int nextInt() {
            return Integer.parseInt(next());
        }

        int fi() {
            String t = next();
            int cur = 0;
            boolean n = t.charAt(0) == '-';
            for (int a = n ? 1 : 0; a < t.length(); a++) {
                cur = cur * 10 + t.charAt(a) - '0';
            }
            return n ? -cur : cur;
        }

        long nextLong() {
            return Long.parseLong(next());
        }

        double nextDouble() {
            return Double.parseDouble(next());
        }
    }

}


import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

public class GB17C {
	public static void main(String[] args) throws NumberFormatException, IOException {

			BufferedReader sc = new BufferedReader(new InputStreamReader(System.in));

			String[] dir = sc.readLine().split(" ");
			int n = Integer.parseInt(dir[0]);
			int r = Integer.parseInt(dir[1]);

			String[] t = sc.readLine().split(" ");
			int[] list = new int[n];
			for(int x=0; x<n; x++){
				list[x] = Integer.parseInt(t[x]);
			}

			double[] yCoords = new double[n];

			for(int x=0; x<n; x++){
				double stop = (double)r;
				int dist = 2*r;
				int xCoordNew = list[x];

				for(int y=0; y<x; y++){

					int xCoordOld = list[y];
					if(Math.abs(xCoordNew - xCoordOld) == dist){
						stop = Math.max(stop, yCoords[y]);
					}
					else if(Math.abs(xCoordNew - xCoordOld) < dist){
						double extra = Math.pow((double)(dist*dist) - (double)((xCoordNew - xCoordOld)*(xCoordNew - xCoordOld)), 0.5);

						stop = Math.max(stop, yCoords[y] + extra);
					}
				}

				yCoords[x] = stop;
				System.out.print(stop+" ");
			}

	}
}

/*

BufferedReader sc = new BufferedReader(new InputStreamReader(System.in));

int n = Integer.parseInt(sc.readLine());
String[] t = sc.readLine().split(" ");
int[] list = new int[n];
for(int x=0; x<n; x++){
	list[x] = Integer.parseInt(t[x]);
}

String[] dir = sc.readLine().split(" ");
int a = Integer.parseInt(dir[0]);
int b = Integer.parseInt(dir[1]);
int c = Integer.parseInt(dir[2]);
int d = Integer.parseInt(dir[3]);
int e = Integer.parseInt(dir[4]);

int n = Integer.parseInt(sc.readLine());

*/


import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.Reader;
import java.util.*;

public class C {
  public static void main(String[] args) {
    FastScanner sc = new FastScanner();

    int n = sc.nextInt();
    long r = sc.nextInt();
    double d = 2 * r;
    long[] xs = sc.readLongArray(n);
    P[] points = new P[n];
    StringBuilder sb = new StringBuilder();
    for (int i = 0; i < n; i++) {
      if (i > 0) sb.append(' ');
      double y = r;
      for (int j = 0; j < i; j++) {
        long diff = Math.abs(xs[i] - points[j].x);
        if (diff <= 2 * r) {
          double dy = Math.sqrt(d * d - diff * diff);
          double testY = points[j].y + dy;
          y = Math.max(y, testY);
        }
      }

      sb.append(y);
      points[i] = new P(xs[i], y);
    }
    System.out.println(sb);
  }

  static class P {
    final long x;
    final double y;

    public P(long x, double y) {
      this.x = x;
      this.y = y;
    }
  }

  static void shuffle(int[] arr) {
    Random rng = new Random();
    int length = arr.length;
    for (int idx = 0; idx < arr.length; idx++) {
      int toSwap = idx + rng.nextInt(length - idx);
      int tmp = arr[idx];
      arr[idx] = arr[toSwap];
      arr[toSwap] = tmp;
    }
  }

  public static class FastScanner {
    BufferedReader br;
    StringTokenizer st;

    public FastScanner(Reader in) {
      br = new BufferedReader(in);
    }

    public FastScanner() {
      this(new InputStreamReader(System.in));
    }

    String next() {
      while (st == null || !st.hasMoreElements()) {
        try {
          st = new StringTokenizer(br.readLine());
        } catch (IOException e) {
          e.printStackTrace();
        }
      }
      return st.nextToken();
    }

    int nextInt() {
      return Integer.parseInt(next());
    }

    long nextLong() {
      return Long.parseLong(next());
    }

    double nextDouble() {
      return Double.parseDouble(next());
    }

    String readNextLine() {
      String str = "";
      try {
        str = br.readLine();
      } catch (IOException e) {
        e.printStackTrace();
      }
      return str;
    }

    int[] readIntArray(int n) {
      int[] a = new int[n];
      for (int idx = 0; idx < n; idx++) {
        a[idx] = nextInt();
      }
      return a;
    }

    long[] readLongArray(int n) {
      long[] a = new long[n];
      for (int idx = 0; idx < n; idx++) {
        a[idx] = nextLong();
      }
      return a;
    }
  }
}