#P3138. [USACO16FEB] Load Balancing S
[USACO16FEB] Load Balancing S
Description
Farmer John has cows () scattered across his farm. The farm is an infinite 2D plane, and the -th cow is located at (it is guaranteed that and are positive odd integers, and ). No two cows are at the same position.
FJ wants to build a vertical fence with equation , and a horizontal fence with equation . To ensure the fences do not pass through any cow, both and must be even. It is easy to see that these two fences intersect at , partitioning the farm into four regions.
FJ wants the number 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 possible value of .
7
7 3
5 5
7 13
3 1
11 7
5 3
9 1
2
Hint
Translated by ChatGPT 5
京公网安备 11011102002149号