#K35222. Total Minimum Chebyshev Distance
Total Minimum Chebyshev Distance
Total Minimum Chebyshev Distance
You are given paths of birds represented by their starting and ending coordinates on a 2D plane. For each bird, the cost of traveling is defined by the Chebyshev distance, which is given by \( d = \max(|x_2 - x_1|, |y_2 - y_1|) \).
Your task is to compute the total minimum distance that all birds would travel, which is simply the sum of the Chebyshev distances for each path.
Note: The Chebyshev distance between two points \((x_1, y_1)\) and \((x_2, y_2)\) is defined as \( \max(|x_2-x_1|, |y_2-y_1|) \).
inputFormat
The first line contains a single integer \( n \) representing the number of birds (paths). Each of the following \( n \) lines contains four space-separated integers: \( x_1\), \( y_1\), \( x_2\), and \( y_2 \), representing the starting and ending coordinates of a bird's path.
outputFormat
Output a single integer, the sum of the minimum Chebyshev distances for all pathways.
## sample1
0 0 3 3
3
</p>