Muennighoff/xP3x-sample huggingface dataset:
inputs: import java.io.*;
import java.math.BigInteger;
import java.util.StringTokenizer;
import java.util.function.Function;

public class D {
    public static void main(String[] args) throws IOException {
        try (Input input = new StandardInput(); PrintWriter writer = new PrintWriter(System.out)) {
            long[] s = new long[40];
            for (int i = 1; i < s.length; i++) {
                s[i] = 1 + 4 * s[i - 1];
                if (i >= 32) {
                    s[i] = Long.MAX_VALUE;
                }
            }
            Function<Integer, Long> getS = (i) -> (i < s.length) ? s[i] : Long.MAX_VALUE;
            int t = input.nextInt();
            testCase:
            for (int tt = 0; tt < t; tt++) {
                int n = input.nextInt();
                long k = input.nextLong();
                long kk = 1;
                BigInteger maxDivisions = BigInteger.ZERO;
                for (int division = 1; division <= n; division++) {
                    long needToDivide = (1L << division) - 1;
                    if (needToDivide > k) {
                        writer.println("NO");
                        continue testCase;
                    }
                    k -= needToDivide;
                    maxDivisions = maxDivisions.add(BigInteger.valueOf(kk).multiply(BigInteger.valueOf(getS.apply(n - division))));
                    if (maxDivisions.compareTo(BigInteger.valueOf(k)) >= 0) {
                        writer.println("YES " + (n - division));
                        continue testCase;
                    }
                    kk += (1L << division + 1);
                }
                writer.println("NO");
            }
        }
    }

    interface Input extends Closeable {
        String next() throws IOException;

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

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

    private static class StandardInput... Which one is the correct time complexity of the code snippet: constant, linear, quadratic, cubic, log(n), nlog(n) or NP-hard?
targets: logn
inputs: import java.util.*;
import java.io.*;

public class Main {

	BufferedReader in;
	StringTokenizer str = null;
	PrintWriter out;
	
	private String next() throws Exception{
		if (str == null || !str.hasMoreElements())
			str = new StringTokenizer(in.readLine());
		return str.nextToken();
	}
	
	private int nextInt() throws Exception{
		return Integer.parseInt(next());
	}
	
	private long nextLong() throws Exception{
		return Long.parseLong(next());
	}
	
	private double nextDouble() throws Exception{
		return Double.parseDouble(next());
	}
	
	public void run() throws Exception{
		in =  new BufferedReader(new InputStreamReader(System.in));
		out = new PrintWriter(System.out);

		long n = nextLong();
		if (n == 1) {
			System.out.println(0);
			return;
		}
		long k = nextLong();
		long t = 1-(k-1) + k*(k+1)/2-1;
		if (t < n){
			System.out.println(-1);
			return;
		}

		long l = 0;
		long r = k;

		while(r - l > 1) {
			long m = (r + l)/2;
			long s = 1 - m + k*(k+1)/2 - (k-m)*(k-m+1)/2;
			//System.out.println(m + " " + s + " " + n);
			if (s >= n){
				r = m;
			}else{
				l = m;
			}
		}
		System.out.println(r);
		out.close();
	}
		
	public static void main(String[] args) throws Exception{
		new Main().run();
	}
}
 Which one is the correct time complexity of the code snippet: constant, linear, quadratic, cubic, log(n), nlog(n) or NP-hard?
targets: logn
inputs: import java.io.*;
import java.util.*;

public class p343a
{
    public static void main(String args[])
    {
        Scanner sc = new Scanner(System.in);
        System.out.println();
        long a = sc.nextLong();
        long b = sc.nextLong();
        if(a==b) System.out.println("1");
        else if(b==1) System.out.println(a);
        else if(a==1) System.out.println(b);
        else if(a>b) System.out.println(count(a,b));
        else System.out.println(count(b,a));
    }

    public static long count(long a,long b)
    {
        long count = 0;
        while(b!=1)
        {
            long c = a/b;
            count += c;
            long d = a-(c*b);
            a = b;
            b = d;
            if(b==1)
            {
                count += a;
                break;
            }
        }
        return count;
    }
} Which one is the correct time complexity of the code snippet: constant, linear, quadratic, cubic, log(n), nlog(n) or NP-hard?
targets: constant
inputs: import java.util.Locale;
import java.util.Scanner;

public class PipelineSolver {

    private long n;

    private long k;

    public static void main(String[] args) {
        PipelineSolver solver = new PipelineSolver();

        solver.readData();
        int solution = solver.solve();
        solver.print(solution);
    }

    private int gcd(int a, int b) {
        return b == 0 ? a : gcd(b, a % b);
    }

    private int lcm(int a, int b) {
        return a * b / gcd(a, b);
    }

    private void print(int[] values) {
        StringBuilder builder = new StringBuilder();

        for (int value : values) {
            builder.append(value);
            builder.append(" ");
        }

        print(builder);
    }

    private void print(Object value) {
        System.out.println(value);
    }

    private void print(boolean value) {
        System.out.println(value ? "YES" : "NO");
    }

    private void print(int value) {
        System.out.println(value);
    }

    private void print(long value) {
        System.out.println(value);
    }

    private void print(double value) {
        System.out.printf(Locale.ENGLISH, "%.10f", value);
    }

    private int[] getDigits(int number) {
        int[] digits = new int[10];
        int index = digits.length - 1;
        int digitsCount = 0;

        while (number > 0) {
            digits[index] = number % 10;
            number /= 10;
            index--;
            digitsCount++;
        }

        int[] result = new int[digitsCount];

        System.arraycopy(digits, digits.length - digitsCount, result, 0, digitsCount);

        return result;
    }

    private int[] readArray(Scanner scanner, int size) {
        int[] result = new int[size];

        for (int i = 0; i < size; i++) {
            result[i] = scanner.nextInt();
        }

        return result;
    }

    private void readData() {
        Scanner scanner = new Scanner(System.in);

        n = scanner.nextLong();
        k = scanner.nextLong();
    }

    private int solve() {

       ... What is the time complexity of the previous code?
targets: logn
inputs: import java.io.*;
import java.util.Scanner;

/**
 * @author pvasilyev
 * @since 8/16/13
 */
public class ProblemC {

    public static final String FILE_IN = "std.in";
    public static final String FILE_OUT = "std.out";
    private static boolean debugMode = true;
    private static final long MOD = 1000 * 1000 * 1000 + 9;

    public static void main(String[] args) throws IOException {

        final Scanner reader = new Scanner(new InputStreamReader(debugMode ? System.in : new FileInputStream(FILE_IN)));
        final PrintWriter writer = new PrintWriter(debugMode ? System.out : new FileOutputStream(FILE_OUT));

//        final long start = System.currentTimeMillis();
        solveTheProblem(reader, writer);
//        System.out.println(System.currentTimeMillis() - start);

        reader.close();
        writer.close();
    }

    private static void solveTheProblem(final Scanner reader, final PrintWriter writer) {

        final long n = reader.nextLong();
        final long m = reader.nextLong();
        final long k = reader.nextLong();

        if (n - n/k >= m) {
            writer.println(m);
            return;
        } else {
            long sum = 1;
            long maxK = m - n + n/k;
            sum = fastPow(2, maxK);
            sum = 2 * (sum - 1);
            sum = sum % MOD;
            sum *= k;
            sum += m - maxK * k;
            writer.println(sum % MOD);
        }

    }

    private static long fastPow(final int exp, final long deg) {
        if (deg == 0) {
            return 1;
        } else if (deg == 1) {
            return exp;
        } else if (deg % 2 == 0) {
            long temp = fastPow(exp, deg / 2);
            temp = (temp * temp) % MOD;
            return temp;
        } else {
            long temp = fastPow(exp, deg / 2);
            temp = (temp * temp) % MOD;
            return (temp * exp) % MOD;
        }
    }


}
 Which one is the correct time complexity of the code snippet: constant, linear, quadratic, cubic, log(n), nlog(n) or NP-hard?
targets: logn
inputs: 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.*;
public class B{
	static int[][] hor;
	static int[][] ver;
	static int n;
	static int m;
	static int k;
	static long[][][] dp;
	
	static long dist(int row, int col)
	{
		if(k%2==1)return Integer.MAX_VALUE;
		return 2*make(row,col,k/2);
	}
	
	static long make(int row, int col, int moves)
	{
		if(moves == 0)
		{
			return 0;
		}
		
		if(dp[row][col][moves]!=-1)return dp[row][col][moves];
		
		long ans = Long.MAX_VALUE;
		
		if(col-1>=0)
		{
			ans = Math.min(ans, hor[row][col-1]+make(row,col-1,moves-1));
		}
		if(col+1<m)
		{
			ans = Math.min(ans, hor[row][col]+make(row,col+1,moves-1));
		}
		if(row-1>=0)
		{
			ans = Math.min(ans, ver[row-1][col]+make(row-1,col,moves-1));
		}
		if(row+1<n)
		{
			ans = Math.min(ans, ver[row][col]+make(row+1,col,moves-1));
		}
		dp[row][col][moves] = ans;
		return ans;
	}
	
	public static void main(String[] args)
	{
		FastScanner fs = new FastScanner();
		PrintWriter out = new PrintWriter(System.out);
		n = fs.nextInt(); m = fs.nextInt(); k = fs.nextInt();
		hor = new int[n][m]; ver = new int[n][m];
		dp = new long[505][505][24];
		for(int i=0;i<505;i++)for(int j=0;j<505;j++)for(int k=0;k<24;k++)dp[i][j][k] = -1;
		for(int i=0;i<n;i++)
		{
			for(int j=0;j<m-1;j++)
			{
				int a = fs.nextInt();
				hor[i][j] = a;
			}
		}
		
		for(int row=0;row<n-1;row++)
		{
			for(int col =0;col<m;col++)
			{
				int a = fs.nextInt();
				ver[row][col] = a;
			}
		}

		
		for(int row=0;row<n;row++)
		{
			for(int col=0;col<m;col++)
			{
				long d = dist(row,col);
				if(d<Integer.MAX_VALUE)
				{
					out.print(d+" ");
				}
				else out.print("-1 ");
			}
			out.println();
		}
		out.close();
	}
	static class FastScanner {
		BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
		StringTokenizer st=new StringTokenizer("");
		String next() {
			while (!st.hasMoreTokens())
				try {
					st=new StringTokenizer(br.readLine());
				} catch (IOException e) {
					e.printStackTrace();
				}
			return st.nextToken();
		}
		
		int nextInt()... Complexity:
targets: cubic
inputs: Identify the time complexity of the following code as constant, linear, quadratic, cubic, log(n), nlog(n) or NP-hard. import java.util.*;
public class x
{
    public static void main(String args[])
    {
        Scanner obj=new Scanner(System.in);
        int n;
        String d="0";
        n=obj.nextInt();
        if(n%4==0 || n%7==0 || n%47==0 || n%74==0 || n%447==0 || n%474==0 || n%747==0)
        d="YES";
        else if(n%444==0 || n%477==0 || n%744==0 || n%774==0 || n%777==0)
        d="YES";
        else
        d="NO";
        System.out.print(d);
    }
} Complexity:
targets: constant
inputs: Identify the time complexity of the following code as constant, linear, quadratic, cubic, log(n), nlog(n) or NP-hard. import java.io.*;
import java.util.*;

public class Main
{
   public static void main(String[] args) throws IOException
   {
      new Main().run();
   }

   StreamTokenizer in;
   PrintWriter out;

   int nextInt() throws IOException
   {
      in.nextToken();
      return (int)in.nval;
   }
   long nextLong() throws IOException
   {
      in.nextToken();
      return (long)in.nval;
   }
   void run() throws IOException
   {
     // in = new StreamTokenizer(new BufferedReader(new FileReader("input.txt")));
     // out = new PrintWriter(new FileWriter("output.txt"));
      in = new StreamTokenizer(new BufferedReader(new InputStreamReader(System.in)));
    out = new PrintWriter(new OutputStreamWriter(System.out));
      solve();
      out.flush();
   }

   void solve() throws IOException
   {
      int N=nextInt();
      int m=nextInt();
      int k=nextInt();
     //  System.out.println("k "+k);
      ArrayList<Integer> ts= new ArrayList<Integer>();
       for (int i = 0; i < N; i++) {
           ts.add(nextInt());
       }
       int count=0,pos=0;
       Collections.sort(ts);
       int jj=ts.size()-1;
      while(m>k){
         
      if((jj<0)||(k==0))
      {pos=1;break;}
      else{
        //  System.out.println(k);
      k+=ts.get(jj) -1;
      jj--;
      count++;
      }
      
      }
      if(pos==0)
           out.println(count);
      else
           out.println("-1");
      
   }
} Complexity:
targets: nlogn
inputs: import java.util.*;
import java.io.*;

public class Main {
    public static void main(String[] args) throws IOException {
        BufferedReader f = new BufferedReader(new InputStreamReader(System.in));
        PrintWriter out = new PrintWriter(new PrintStream(System.out));
        StringTokenizer st = new StringTokenizer(f.readLine());
        int n = Integer.parseInt(st.nextToken());
        int m = Integer.parseInt(st.nextToken());
        long[] arrB = new long[n];
        long[] arrG = new long[m];
        st=new StringTokenizer(f.readLine());
        for(int i=0;i<n;i++){
            arrB[i]=Long.parseLong(st.nextToken());
        }
        st=new StringTokenizer(f.readLine());
        for(int j=0;j<m;j++){
            arrG[j]=Long.parseLong(st.nextToken());
        }
        Arrays.sort(arrB);
        Arrays.sort(arrG);
        long ans = 0;
//        for (int i = 0; i < n; i++) ans += arrB[i] * m;
//        for (int i = 0; i < m - 1; i++) ans += arrG[i] - arrB[0];
//        if (arrB[m - 1] != arrB[0]) {
//            if (arrB.length == 1) {
//                ans=-1;
//            }
//            else ans += arrG[m - 1] - arrB[1];
//        }
//        if (arrG[m-1] < arrB[0]) {
//            ans=-1;
//        }
        for(int i=0;i<n;i++){
            ans+=arrB[i]*(long)m;
        }
        for(int i=1;i<m;i++){
            ans+=arrG[i]-arrB[n-1];
        }
        if(arrB[n-1]!=arrG[0]){
            if(n==1){
                ans=-1;
            }
            else{
                //smallest g goes to second to last
                ans+=arrG[0]-arrB[n-2];
            }
        }
        if(arrB[n-1]>arrG[0]){
            ans=-1;
        }
        System.out.println(ans);
        f.close();
        out.close();
    }
} Which one is the correct time complexity of the code snippet: constant, linear, quadratic, cubic, log(n), nlog(n) or NP-hard?
targets: nlogn
inputs: Identify the time complexity of the following code as constant, linear, quadratic, cubic, log(n), nlog(n) or NP-hard. import java.io.*;
import java.util.*;
import static java.lang.Math.*;

public class A {
    public static void main(String[] args) {
        Scanner input = new Scanner();
        StringBuilder output = new StringBuilder();

        int n = input.nextInt();
        int[] a = new int[n];

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

        Arrays.sort(a);
        boolean[] colored = new boolean[n];
        int colors = 0;
        for (int i = 0; i < n; i++) {
            if (!colored[i]) {
                colors ++;
                colored[i] = true;
                for (int j = i+1; j < n; j++) {
                    if (a[j] % a[i] == 0) {
                        colored[j] = true;
                    }
                }
            }
        }

        System.out.println(colors);
    }

    private static class Scanner {
        BufferedReader br; StringTokenizer st;
        public Scanner(Reader in) { br = new BufferedReader(in); }
        public Scanner() { 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; }
    } // end Scanner
}
 Complexity:
targets: quadratic
inputs: import java.util.*;

public class C{
	static String s;
	static long val[];
	static int N,size;
	static int index(char c){
		if(c <= 'Z'){
			return c - 'A';
		}else{
			return c - 'a' + ('Z' - 'A' + 1);
		}
	}

	static int l(int i){
		return (i<<1)+1;
	}
	static int r(int i){
		return (i<<1)+2;
	}

	static void setup(int l, int r, int i){
		if(l==r){
			val[i] = (1L<<index(s.charAt(l)));
		}else{
			int mid = (l+r)/2;
			setup(l,mid,l(i));
			setup(mid+1,r,r(i));
			val[i] = val[l(i)] | val[r(i)];
		}
	}

	static long query(int min, int max, int l, int r, int i){
		if(min <= l && r <= max){
			return val[i];
		}
		if(max < l || r < min)
			return 0;
		int mid = (l+r)/2;
		return query(min,max,l,mid,l(i)) | query(min,max,mid+1,r,r(i));
	}
	static long query(int min, int max){
		return query(min,max,0,N-1,0);
	}

	static int binarySearch(int start, long toFind){
		int max = N-1;
		int min = start;
		if(query(start,max) != toFind)
			return 1<<29;
		if(query(start,start) == toFind){
			return 1;
		}
		int ret = max - min + 1;
		while(min + 1 < max){
			int mid = (min+max)/2;
			if(query(start,mid) == toFind){
				max = mid;
			}else{
				min = mid;
			}
		}
		return max-start+1;
	}

	public static void main(String args[]){
		Scanner sc = new Scanner(System.in);
		N = sc.nextInt();
		s = sc.next();
		int size = 1;
		while(size <= N) size*=2;
		val = new long[size*2];
		setup(0,N-1,0);

		long toFind = query(0,N-1,0,N-1,0);
		long ans = 1L<<29;
		for(int i = 0; i < N; i++)
			ans = Math.min(ans,binarySearch(i,toFind));
		System.out.println(ans);
	}
} What is the time complexity of the previous code?
targets: linear
inputs: import java.io.*;
import java.util.*;

public class C {

    BufferedReader br;
    PrintWriter out;
    StringTokenizer st;
    boolean eof;

    final int INF = Integer.MAX_VALUE / 2;

    void solve() throws IOException {
        int n = nextInt();
        int m = nextInt();

        if (n > m) {
            int tmp = n;
            n = m;
            m = tmp;
        }
        // n < m !!!!
        // n rows m columns

        if (n == 1) {
            out.print(m - (m + 2) / 3);
            return;
        }

        int[][] dp = new int[n * m + 1][1 << (2 * n)];
        for (int i = 0; i < dp.length; i++)
            Arrays.fill(dp[i], INF);

        dp[0][0] = 0;
        for (int i = 0; i < dp.length - 1; i++) {
            int maxNewMask = (1 << Math.min(2 * n, n * m - i)) - 1;
            for (int mask = 0; mask < dp[i].length; mask++)
                if (dp[i][mask] != INF) {
                    //System.err.println(i + " " + mask + " " + dp[i][mask]);
                    if ((mask & 1) == 1) // already covered, skip
                        dp[i + 1][mask >> 1] = Math.min(dp[i + 1][mask >> 1],
                                dp[i][mask]);
                    // place on this tile
                    int newMask = mask >> 1;
                    if (i % n != n - 1)
                        newMask |= 1;
                    newMask |= 1 << (n - 1);
                    newMask &= maxNewMask;
                    dp[i + 1][newMask] = Math.min(dp[i + 1][newMask],
                            dp[i][mask] + 1);

                    if (i % n != n - 1) {// place on next tile
                        newMask = mask >> 1;
                        newMask |= 1;
                        if (i % n != n - 2)
                            newMask |= 2;
                        newMask |= (1 << n);
                        newMask &= maxNewMask;
                        dp[i + 1][newMask] = Math.min(dp[i + 1][newMask],
                                dp[i][mask] + 1);
                    }

                    // place on... What is the time complexity of the previous code?
targets: np
inputs: import java.io.*;
import java.util.*;

public class CF1141F {
	static class V {
		int l, r, a;
		V(int l, int r, int a) {
			this.l = l; this.r = r; this.a = a;
		}
	}
	public static void main(String[] args) throws IOException {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		PrintWriter pw = new PrintWriter(System.out);
		int n = Integer.parseInt(br.readLine());
		StringTokenizer st = new StringTokenizer(br.readLine());
		int[] aa = new int[n + 1];
		for (int i = 1; i <= n; i++)
			aa[i] = Integer.parseInt(st.nextToken());
		for (int i = 1; i <= n; i++)
			aa[i] += aa[i - 1];
		int m = n * (n + 1) / 2;
		V[] vv = new V[m];
		m = 0;
		for (int i = 1; i <= n; i++)
			for (int j = i; j <= n; j++)
				vv[m++] = new V(i, j, aa[j] - aa[i - 1]);
		Arrays.sort(vv, (u, v) -> u.a != v.a ? u.a - v.a : u.r - v.r);
		int[] ii_ = new int[m];
		int[] ii = new int[m];
		int k_ = 0;
		for (int i = 0, j; i < m; i = j) {
			j = i + 1;
			while (j < m && vv[j].a == vv[i].a)
				j++;
			int k = 0, r = 0;
			for (int h = i; h < j; h++)
				if (vv[h].l > r) {
					ii[k++] = h;
					r = vv[h].r;
				}
			if (k_ < k) {
				k_ = k;
				int[] tmp = ii_; ii_ = ii; ii = tmp;
			}
		}
		pw.println(k_);
		for (int h = 0; h < k_; h++) {
			int i = ii_[h];
			pw.println(vv[i].l + " " + vv[i].r);
		}
		pw.close();
	}
}
 What is the time complexity of the previous code?
targets: quadratic
inputs: import java.io.*;
import java.util.*;







public class B2 {
	String s = null;

	String[] ss = null;
	int[][] sn = null;
	int n = 0;
	double ans = 1;
	int A = 0;
	public void run() throws Exception{

		BufferedReader br = null;
		File file = new File("input.txt");
		if(file.exists()){
			br = new BufferedReader(new FileReader("input.txt"));
		}
		else{
			br = new BufferedReader(new InputStreamReader(System.in));
		}
	
		s = br.readLine();
		ss = s.split(" ");
		
		
		
		n = Integer.parseInt(ss[0]);
		int k = Integer.parseInt(ss[1]);
		A = Integer.parseInt(ss[2]);
		sn = new int[n][2];

		for(int i = 0; i < n; i++){
			s = br.readLine();
			ss = s.split(" ");
			sn[i][0] = Integer.parseInt(ss[0]);
			sn[i][1] = Integer.parseInt(ss[1]);
		}

		int num = 0;
		for(int i = 0; i < n; i++){
			num += (100 - sn[i][1]) / 10;
		}
		if(k >= num){
			System.out.println("1.0");
			return;
		}
		
		check(0, k, sn);
		
		ans = 1 - ans;
		System.out.println(ans);
		
	}
	
	void check(int i, int k, int[][] sn){
		if(i == n && k == 0){
			check2(sn);
			return;
		}
		else if(i == n && k > 0){
			return;
		}
		else if(k == 0){
			check(i+1, k, sn);
		}
		else{
			for(int j = 0; j <= k; j++){
				if(sn[i][1] + j * 10 <= 100){
					int[][] nsn = copy(sn);
					nsn[i][1] += j * 10;
					check(i+1, k - j, nsn);
				}
			}
		}
	}
	
	void check2(int[][] sn){
		List<Integer> target = new ArrayList<Integer>();
		int h = 0;
		for(int i = 0; i < sn.length; i++){
			if(sn[i][1] != 100){
				target.add(i);
			}
			else{
				h++;
			}
		}
		if(h  > n / 2){
			System.out.println("1.0");
			System.exit(0);	
		}
		int makemax = n - h;
		int makemin = (n+1)/2;
		double ma = 0;
		for(int i = makemax; i >= makemin; i--){
			Combination c = new Combination(makemax, i);
			Iterator<int[]> ite = c.iterator();
			
			while(ite.hasNext()){
				int[] ret = ite.next();
				Set<Integer> make = new HashSet<Integer>();
				for(int j = 0; j < ret.length; j++){
					if(ret[j] > 0){
						make.add(target.get(j));
					}
				}
				double makeK = 1;
				int B... Which one is the correct time complexity of the code snippet: constant, linear, quadratic, cubic, log(n), nlog(n) or NP-hard?
targets: np
inputs: 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:
targets: quadratic
inputs: Identify the time complexity of the following code as constant, linear, quadratic, cubic, log(n), nlog(n) or NP-hard. import java.util.*;
public class Test { public static void main(String[] args)
{
Scanner sc = new Scanner(System.in);
int n= sc.nextInt();
int x= (int)Math.sqrt(n) ;
int a[] = new int[n+5];
for(int i=1,o=n,j;i<=n;i+=x)
for(j=(int)Math.min(i+x-1,n);j>=i;a[j--]=o--);
for(int i=1;i<=n;i++)System.out.print(a[i]+" ");
System.out.println();


} 
} Complexity:
targets: linear
inputs: import static java.util.Arrays.*;
import static java.lang.Math.*;
import java.util.*;
import java.io.*;

public class A implements Runnable
{
	public static void main(String [] args) throws IOException
	{
		new Thread(null, new A(), "", 1 << 20).start();
	}
	
	String file = "input";
	BufferedReader input;
	PrintWriter out;
	
	public void run() 
	{
		try
		{
			//input = new BufferedReader(new FileReader(file + ".in"));
			input = new BufferedReader(new InputStreamReader(System.in));
			out = new PrintWriter(new BufferedOutputStream(System.out));
			solve();
			input.close();
			out.close();
		}
		catch(Exception e)
		{
			e.printStackTrace();
			System.exit(1);
		}
	}
	int N, T;
	void solve() throws IOException
	{
		StringTokenizer st = tokens();
		N = nextInt(st); T = nextInt(st);
		T *= 2;
		ArrayList<Pair> list = new ArrayList<Pair>();
		for(int i = 0; i < N; i++)
		{
			st = tokens();
			int c = nextInt(st), L = nextInt(st);
			c *= 2; L *= 2;
			list.add(new Pair(c - L / 2, c + L / 2));
		}
		Collections.sort(list);
		HashSet<Integer> set = new HashSet<Integer>();
		for(int i = 0; i < list.size(); i++)
		{
			if(i == 0 || list.get(i).x - list.get(i - 1).y >= T)
			{
				set.add(list.get(i).x - T / 2);
			}
			if(i == list.size() - 1 || list.get(i + 1).x - list.get(i).y >= T)
			{
				set.add(list.get(i).y + T / 2);
			}
		}
		System.out.println(set.size());
	}
	class Pair implements Comparable<Pair>
	{
		int x, y;
		public Pair(int x, int y)
		{
			this.x = x;
			this.y = y;
		}
		public int compareTo(Pair p)
		{
			if(x != p.x) return x - p.x;
			return y - p.y;
		}
	}

	StringTokenizer tokens() throws IOException
	{
		return new StringTokenizer(input.readLine());
	}
	
	String next(StringTokenizer st)
	{
		return st.nextToken();
	}
	
	int nextInt() throws IOException
	{
		return Integer.parseInt(input.readLine());
	}
	
	int nextInt(StringTokenizer st)
	{
		return Integer.parseInt(st.nextToken());
	}
	
	double nextDouble() throws IOException
	{
		return Double.parseDouble(input.readLine());
	}
	
	double... Which one is the correct time complexity of the code snippet: constant, linear, quadratic, cubic, log(n), nlog(n) or NP-hard?
targets: nlogn
inputs: Identify the time complexity of the following code as constant, linear, quadratic, cubic, log(n), nlog(n) or NP-hard. import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.util.StringTokenizer;

public class D5 implements Runnable {

	final double eps = 1e-9;

	private void Solution() throws IOException {
		double a = nextDouble(), v = nextDouble();
		double l = nextDouble(), d = nextDouble(), w = nextDouble();
		double t = 0;
		if (w + eps > v) {
			double s = v * v / (2 * a);
			if (s + eps > l)
				t = Math.sqrt(2 * l / a);
			else {
				double ta = v / a;
				double sa = a * ta * ta / 2;
				t = ta + (l - sa) / v;
			}
		} else {
			double sv = v * v / (2 * a);
			double sw = w * w / (2 * a);
			if (sw + eps > d) {
				if (sv + eps > l)
					t = Math.sqrt(2 * l / a);
				else {
					double ta = v / a;
					double sa = a * ta * ta / 2;
					t = ta + (l - sa) / v;
				}
			} else {
				double sd = (w * w - v * v) / (-2 * a);
				if (sv + sd < eps + d)
					t = v / a + (d - sv - sd) / v + (v - w) / a;
				else {
					double f = Math.sqrt(d * a + w * w / 2);
					t = f / a + (f - w) / a;
				}
				if (sd + eps > l - d) {
					double lv = Math.sqrt((l - d) * 2 * a + w * w);
					t += (lv - w) / a;
				} else {
					t += (v - w) / a + (l - d - sd) / v;
				}
			}
		}
		out.printf("%.12f", t);
	}

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

	BufferedReader in;
	PrintWriter out;
	StringTokenizer tokenizer;

	public void run() {
		try {
			in = new BufferedReader(new InputStreamReader(System.in));
			out = new PrintWriter(System.out);
			Solution();
			out.close();
		} catch (Exception e) {
			e.printStackTrace();
			System.exit(0);
		}
	}

	void print(Object... obj) {
		for (int i = 0; i < obj.length; i++) {
			if (i != 0)
				out.print(" ");
			out.print(obj[i]);
		}
	}

	void println(Object... obj) {
		print(obj);
		print("\n");
	}

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

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

	double nextDouble() throws... Complexity:
targets: constant
inputs: Identify the time complexity of the following code as constant, linear, quadratic, cubic, log(n), nlog(n) or NP-hard. import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.util.ArrayList;
import java.util.Collections;
import java.util.Comparator;


public class pr988B {
    public static void main(String[] args) throws IOException {
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        PrintWriter out = new PrintWriter(System.out);

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

        ArrayList<String> a = new ArrayList<>();

        for (int i = 0; i < n; i++) {
            a.add(br.readLine());
        }

        if(solve(n, a)){
            out.println("YES");
            for (String s : a) {
                out.println(s);
            }
        }
        else
            out.println("NO");

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

    private static boolean solve(int n, ArrayList<String> a) {
        a.sort(Comparator.comparingInt(String::length));
        for (int i = 0; i < n - 1; i++) {
            if(!a.get(i+1).contains(a.get(i))) return false;
        }
        return true;
    }
}
 Complexity:
targets: nlogn
inputs: import java.io.*;
import java.util.*;

public class Pr468B {
	public static void main(String[] args) throws IOException {
		new Pr468B().run();
	}

	BufferedReader in;
	PrintWriter out;
	StringTokenizer st;

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

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

	void run() throws IOException {
		in = new BufferedReader(new InputStreamReader(System.in));
		out = new PrintWriter(System.out, true);
		solve();
		out.flush();
	}

	int[] which;
	boolean[] was;
	int[] pa;
	int[] pb;

	void dfs(int i, boolean fa) {
		was[i] = true;
		if (fa) {
			if (pa[i] == -1) {
				out.println("NO");
				out.flush();
				System.exit(0);
			}
			which[i] = 0;
			which[pa[i]] = 0;
			if (pb[pa[i]] != -1 && !was[pb[pa[i]]]) {
				dfs(pb[pa[i]], fa);
			}
		} else {
			if (pb[i] == -1) {
				out.println("NO");
				out.flush();
				System.exit(0);
			}
			which[i] = 1;
			which[pb[i]] = 1;
			if (pa[pb[i]] != -1 && !was[pa[pb[i]]]) {
				dfs(pa[pb[i]], fa);
			}
		}
	}

	void solve() throws IOException {
		int n = nextInt();
		int a = nextInt();
		int b = nextInt();
		int[] p = new int[n];
		HashMap<Integer, Integer> allNums = new HashMap<Integer, Integer>();
		for (int i = 0; i < n; i++) {
			p[i] = nextInt();
			if (p[i] >= Math.max(a, b)) {
				out.println("NO");
				return;
			}
			allNums.put(p[i], i);
		}
		pa = new int[n];
		pb = new int[n];
		Arrays.fill(pa, -1);
		Arrays.fill(pb, -1);
		which = new int[n];
		Arrays.fill(which, -1);
		for (int i = 0; i < n; i++) {
			if (pa[i] == -1 && allNums.containsKey(a - p[i])) {
				pa[i] = allNums.get(a - p[i]);
				pa[pa[i]] = i;
			}
			if (pb[i] == -1 && allNums.containsKey(b - p[i])) {
				pb[i] = allNums.get(b - p[i]);
				pb[pb[i]] = i;
			}
			if (pa[i] == -1 && pb[i] == -1) {
				out.println("NO");
				return;
			}
		}
		was = new boolean[n];
		for (int i = 0; i < n; i++) {
			if (!was[i] &&... What is the time complexity of the previous code?
targets: linear
inputs: import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.Arrays;
import java.util.InputMismatchException;
import java.io.IOException;
import java.io.InputStream;

/**
 * Built using CHelper plug-in
 * Actual solution is at the top
 *
 * @author beginner1010
 */
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);
        TaskG1 solver = new TaskG1();
        solver.solve(1, in, out);
        out.close();
    }

    static class TaskG1 {
        final int mod = (int) 1e9 + 7;
        int[][][] dp;

        int rec(int mask, int time, int T, int genre, int[] ts, int[] gs) {
            if (time > T)
                return 0;
            if (time == T)
                return 1;
            if (mask == (1 << ts.length) - 1)
                return 0;
            int res = dp[genre][time][mask];
            if (res != -1)
                return res;
            res = 0;
            for (int i = 0; i < ts.length; i++) {
                if ((mask & (1 << i)) == 0 && (mask == 0 || gs[i] != genre)) {
                    res += rec(mask | (1 << i), time + ts[i], T, gs[i], ts, gs);
                    if (res >= mod)
                        res -= mod;
                }
            }
            return dp[genre][time][mask] = res;
        }

        public void solve(int testNumber, InputReader in, PrintWriter out) {
            int n = in.nextInt();
            int[] ts = new int[n];
            int[] gs = new int[n];
            int T = in.nextInt();
            for (int i = 0; i < n; i++) {
                ts[i] = in.nextInt();
                gs[i] = in.nextInt() - 1;
            }
            dp = new int[3][T][1 << n];
            for (int[][] aux : dp) {
                for (int[] aux2 : aux)
                    Arrays.fill(aux2,... Which one is the correct time complexity of the code snippet: constant, linear, quadratic, cubic, log(n), nlog(n) or NP-hard?
targets: np
inputs: Identify the time complexity of the following code as constant, linear, quadratic, cubic, log(n), nlog(n) or NP-hard. import java.io.BufferedReader;
import java.io.FileReader;
import java.io.IOException;
import java.io.PrintWriter;
import java.util.*;

public class CodeForces {
    class Pair<K, V> {
        K first;
        V second;
        public Pair(K k, V v) {
            first = k;
            second = v;
        }
    }
    private boolean contain(int set, int i) {
        return (set & (1<<i)) > 0;
    }

    private static int gcd(int a, int b) {
        if (b == 0) return a;
        return gcd(b, a%b);
    }
    
    private long pow(long a, long p) {
        if (p == 0) return 1;
        long b = pow(a, p/2);
        b = b * b;
        if (p % 2 == 1) b *= a;
        return b % mod;
    }
    
    private static boolean isSame(double a, double b) {
        return Math.abs(a - b) < 1e-10;
    }

    private static void swapBoolean(boolean[] p, int i, int j) {
        boolean tmp = p[i];
        p[i] = p[j];
        p[j] = tmp;
    }

    private static void swap(int[] p, int i, int j) {
        int tmp = p[i];
        p[i] = p[j];
        p[j] = tmp;
    }
    private static int countOne(int a) {
        if (a == 0) return 0;
        return countOne(a & (a-1)) + 1;
    }

    private static int sdiv(int a, int b) {
        return (a +b -1) / b;
    }

    private int[] retran(int index) {
        int[] res = new int[2];
        res[0] = index / M;
        res[1] = index % M;
        return res;
    }

    private int tran(int x, int y) {
        return x * M + y;
    }

    private boolean inTable(int x, int y) {
        return x>=0 && x< N && y >= 0 && y < M;
    }

    int N;
    int R;
    int[][] C = new int[10][10];
    int M;
    int mod = 1_000_000_007;
    long IMPO;
    int ans;

    int[] dx = new int[]{1,0, -1, 0};
    int[] dy = new int[]{0, -1, 0, 1};
    Map<String, Boolean> dp = new HashMap<>();

    class Edge {
        int u;
        int v;
        int start;
        int duration;
        public Edge(int u, int v, int l, int d) {
            this.u = u;
            this.v = v;
           ... Complexity:
targets: logn
inputs: import java.io.*;
import java.util.*;

public class Main { 
    public static void main(String[] args) throws IOException { 
        //InputStream input = System.in;
        //OutputStream output = System.out;
        InputReader in = new InputReader(new FileReader(new File("input.txt")));
        PrintWriter out = new PrintWriter(new FileWriter(new File("output.txt")));
        //InputReader in = new InputReader(input);
        //PrintWriter out = new PrintWriter(output);
        Solution s = new Solution();
        s.solve(1, in, out);
        out.close();
    }

    static class Solution { 
        
        double EPS = 0.0000001;
        public void solve(int cs, InputReader in, PrintWriter out) {

            int n = in.nextInt(), m = in.nextInt();
            Graph g = new Graph(n, m);
            int k = in.nextInt();
            for (int[] v : g.vis)
                Arrays.fill(v, -1);
            while (k-- > 0) {
                Pair start = new Pair(in.nextInt()-1, in.nextInt()-1);
                g.bfs(start);
            }
            int idx1 = 0, idx2 = 0, max = 0;
            for (int i = 0; i < n; i++) {
                for (int j = 0; j < m; ++j) {
                    if (g.vis[i][j] > max) {
                        idx1 = i;
                        idx2 = j;
                        max = g.vis[i][j];
                    }
                }
            }
            out.println((idx1+1) + " " + (idx2+1));
        }

        static class Pair {
            int x, y;

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

        static class Graph {
            LinkedList<Integer> adj[];
            int n, e;
            int[][] vis;

            @SuppressWarnings("unchecked")
            public Graph(int n, int e) {
                this.n = n;
                this.e = e;
                adj = new LinkedList[n];
                for (int i = 0; i < n; ++i)
                    adj[i] = new LinkedList<>();
                vis =... What is the time complexity of the previous code?
targets: cubic