P2213 [USACO14MAR] The Lazy Cow S

Description

It's a hot summer day, and Bessie the cow is feeling quite lazy. She wants to locate herself at a position in her field so that she can reach as much delicious grass as possible within only a short distance. The field Bessie inhabits is described by an N by N grid of square cells (1

Input Format

* Line 1: The integers N and K. * Lines 2..1+N: Line r+1 contains N integers describing row r of the grid.

Output Format

* Line 1: The maximum amount of grass Bessie can reach, if she chooses the best possible initial location (the location from which she can reach the most grass).

Explanation/Hint

OUTPUT DETAILS: In the example above, Bessie can reach 342 total units of grass if she locates herself in the middle of the grid. Source: USACO 2014 March Contest, Silver