Farmer John's N cows each stand at a distinct location (x1,y1),…,(xN,yN) on his two-dimensional farm. Every coordinate xi and yi is a positive odd integer no larger than B.
John wants to split the farm with a north-south fence of effectively infinite length, given by the equation x=a. The value a is even, so the fence never runs through the spot where a cow stands. He also builds an east-west fence of effectively infinite length given by y=b, where b is even as well. The two fences cross at the point (a,b) and cut the farm into four regions.
John wants the cows spread evenly over the four regions, with no single region holding too many of them. Let M be the number of cows in the most crowded of the four regions. Find the smallest value of M he can reach.