luogu#P5098. [USACO04OPEN] Cave Cows 3
[USACO04OPEN] Cave Cows 3
Problem Description
Farmer John's () cows are exploring a large room in a cave. It is dark, and the cows communicate by mooing loudly at each other.
Due to the strange accoustics of the room, the time it takes for a 'moo' from one cow to reach another cow is proportional to the "manhattan" distance between the two cows: that is, if cow A is at location and cow B is at location , it takes units of time for a 'moo' from cow A to reach cow B. and coordinates are all in the range .
Given the locations of the cows, determine the maximum time over all pairs of cows for a 'moo' to propagate.
Input Format
-
Line : A single integer: .
-
Lines : Each line contains two space-separated integers, giving the coordinates of a cow.
Output Format
- Line : The maximum 'moo' distance among all pairs of cows
5
1 1
3 5
2 7
8 1
4 4
12
Hint
OUTPUT DETAILS:
The cows at and are separated by units.