P3075 [USACO13FEB] Partitioning the Farm G

题目描述

Farmer John's farm is divided into an N x N square grid of pastures (2

输入格式

\* Line 1: Two integers, N and K \* Lines 2..1+N: There are N numbers per line, describing the cows in each pasture for one row of the farm (there are at least 0 and at most 1000 cows in each pasture)

输出格式

\* Line 1: The minimum possible size of the largest group of cows.

说明/提示

Farmer John should build fences between columns 2 and 3 and between rows 2 and 3, which creates 4 groups each with 4 cows.