#C1439. Drone Delivery Minimum Time

    ID: 44033 Type: Default 1000ms 256MiB

Drone Delivery Minimum Time

Drone Delivery Minimum Time

You are given a fleet of drones that must deliver packages to various destinations on a 2D coordinate plane. Each package is assigned a destination point. The delivery time for a package is determined by the maximum of the absolute values of its x and y coordinates, i.e., (\max(|x|,|y|)). In one unit of time, a drone can move 1 unit in any direction (up, down, left, or right). The goal is to calculate the minimum time required to deliver all packages.

Formally, given an integer (n) representing the number of packages and (n) pairs of integers ((x_i, y_i)) representing the destination coordinates of each package, compute the minimum time required so that all drones deliver their packages, which is:
[ T = \max_{1 \leq i \leq n} \left(\max\left(|x_i|,|y_i|\right)\right)]

inputFormat

The input is given via standard input (stdin) and consists of:
1. A single integer (n) representing the number of packages.
2. (n) lines follow, each containing two space-separated integers (x) and (y) that represent the coordinates of the destination for each package.

outputFormat

Output a single integer representing the minimum time required to deliver all packages. The output should be written to standard output (stdout).## sample

3
1 2
2 3
3 4
4