#P6172. [USACO16FEB] Load Balancing P
[USACO16FEB] Load Balancing P
Description
Farmer John has cows () scattered across the farm. The farm is an infinitely large 2D plane. The position of the -th cow is (it is guaranteed that both and are positive odd numbers, and ), and no two cows are at the same location.
FJ wants to build a vertical fence with equation , and also a horizontal fence with equation . To prevent the fences from passing through any cows, both and must be even numbers. It is easy to see that these two fences intersect at , dividing the farm into four regions.
FJ wants the numbers of cows in the four regions to be as balanced as possible, avoiding the situation where one region has many cows while another has few. Let be the maximum number of cows among the four regions. Please help FJ find the minimum possible value of .
Input Format
The first line contains an integer .
The next lines each contain two integers , describing the position of the -th cow.
Output Format
Output the minimum value of .
7
7 3
5 5
7 13
3 1
11 7
5 3
9 1
2
Hint
Translated by ChatGPT 5
京公网安备 11011102002149号