import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.io.PrintWriter;
import java.io.BufferedWriter;
import java.io.Writer;
import java.io.OutputStreamWriter;
import java.util.InputMismatchException;
import java.io.IOException;
import java.io.InputStream;

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

    static class TaskB {
        int n;
        int startrow;
        int startcol;
        long want;

        boolean check(long time) {
            long max = (long) 2 * time * (time + 1) + 1;
            long highest = startrow - time;
            if(highest < 0) {
                max -= Math.abs(highest) * Math.abs(highest);
            }
            long lowest = startrow + time;
            if(lowest >= n) {
                max -= Math.abs(lowest - n + 1) * Math.abs(lowest - n + 1);
            }
            long leftmost = startcol - time;
            if(leftmost < 0) {
                max -= Math.abs(leftmost) * Math.abs(leftmost);
            }
            long rightmost = startcol + time;
            if(rightmost >= n) {
                max -= Math.abs(rightmost - n + 1) * Math.abs(rightmost - n + 1);
            }
            long upperright = time - (startrow + 1) - (n - startcol);
            if(upperright >= 0) {
                max += (upperright + 1) * (upperright + 2) / 2;
            }
            long lowerright = time - (n - startrow) - (n - startcol);
            if(lowerright >= 0) {
                max += (lowerright + 1) * (lowerright + 2) / 2;
            }
            long upperleft = time - (startrow + 1) -... Which one is the correct time complexity of the code snippet: constant, linear, quadratic, cubic, log(n), nlog(n) or NP-hard?