luogu#P5098. [USACO04OPEN] Cave Cows 3
[USACO04OPEN] Cave Cows 3
Problem Description
John’s () cows are exploring in a pitch-black cave, and they can only communicate by calling.
The time for sound to travel is determined by the Manhattan distance between two cows. That is, for cow 1 and cow 2 to communicate, the required time is . Here, .
What is the maximum communication time among all pairs of cows?
Input Format
The first line contains . Each of the following lines contains the coordinates of one cow.
Output Format
The maximum communication time (i.e., the maximum Manhattan distance).
5
1 1
3 5
2 7
8 1
4 4
12
Hint
Explanation of the sample:
The distance between and is the largest, which is .
Translated by ChatGPT 5