source_code: import java.util.*;
  
  import java.io.*;
  import java.lang.reflect.Array;
  
  public class C {
  	FastScanner in;
  	PrintWriter out;
  	boolean systemIO = true;
  
  	public static class Pair {
  		int x;
  		int y;
  
  		public Pair(int x, int y) {
  			this.x = x;
  			this.y = y;
  		}
  	}
  
  	public void solve() {
  		int n = in.nextInt();
  		int r = 2 * in.nextInt();
  		int[] x = new int[n];
  		for (int i = 0; i < x.length; i++) {
  			x[i] = in.nextInt();
  		}
  		double[] y = new double[n];
  		for (int i = 0; i < y.length; i++) {
  			y[i] = r / 2;
  		}
  		for (int i = 0; i < y.length; i++) {
  			for (int j = 0; j < i; j++) {
  				if (Math.abs(x[i] - x[j]) == r) {
  					y[i] = Math.max(y[i], y[j]);
  				} else if (Math.abs(x[i] - x[j]) < r) {
  					y[i] = Math.max(y[i], y[j] + Math.sqrt(r * r - (x[j] - x[i]) * (x[j] - x[i])));
  				}
  			}
  		}
  		for (int i = 0; i < y.length; i++) {
  			out.print(y[i] + " ");
  		}
  	}
  
  	public void run() {
  		try {
  			if (systemIO) {
  				in = new FastScanner(System.in);
  				out = new PrintWriter(System.out);
  			} else {
  				in = new FastScanner(new File("segments.in"));
  				out = new PrintWriter(new File("segments.out"));
  			}
  			solve();
  
  			out.close();
  		} catch (IOException e) {
  			e.printStackTrace();
  		}
  	}
  
  	class FastScanner {
  		BufferedReader br;
  		StringTokenizer st;
  
  		FastScanner(File f) {
  			try {
  				br = new BufferedReader(new FileReader(f));
  			} catch (FileNotFoundException e) {
  				e.printStackTrace();
  			}
  		}
  
  		FastScanner(InputStream f) {
  			br = new BufferedReader(new InputStreamReader(f));
  		}
  
  		String nextLine() {
  			try {
  				return br.readLine();
  			} catch (IOException e) {
  				return null;
  			}
  		}
  
  		String next() {
  			while (st == null || !st.hasMoreTokens()) {
  				try {
  					st = new StringTokenizer(br.readLine());
  				} catch (IOException e) {
  					e.printStackTrace();
  				}
  			}
  			return st.nextToken();
  		}
  
  		int nextInt() {
  			return Integer.parseInt(next());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