Identify the time complexity of the following code as constant, linear, quadratic, cubic, log(n), nlog(n) or NP-hard. 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 =... Complexity: