Identify the time complexity of the following code as constant, linear, quadratic, cubic, log(n), nlog(n) or NP-hard. 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.util.Scanner;
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);
        TaskD solver = new TaskD();
        solver.solve(1, in, out);
        out.close();
    }

    static class TaskD {
        int found = 0;
        int queryCount = 0;
        int[] result = new int[8];

        public void solve(int testNumber, InputReader in, PrintWriter out) {
            int n = in.nextInt();
            //int n = 100;
            //int n = 65536;


            int left = 1;
            int right = n + 1;
            while (left + 1 < right) {
                int middle = (left + right) / 2;
                int res = query(middle, 1, n, n);
                if (res == 2) left = middle;
                else if (res == 1) {
                    //System.out.println("Searching single: ");
                    findSingle(middle, 1, n, n);
                    found++;
                    break;
                } else {
                    right = middle;
                }
            }

            int top = 1;
            int bottom = n + 1;
            while (top + 1 < bottom) {
                int middle = (top + bottom) / 2;
                int res = query(1, middle, n, n);
                if (res == 2) top = middle;
                else if (res == 1) {
                    if ((found == 0) || (!containsRect(1, middle, n, n, result[0], result[1], result[2], result[3]))) {
                       ... Complexity: