#P2004. 领地选择

领地选择

Description

As a leader who commands countless troops in a virtual world, Xiao Z believes that timing, terrain, and unity among people are all indispensable. Therefore, carefully choosing the location of the capital is very important to Xiao Z.

The capital is considered to be a square occupying C×CC \times C. Xiao Z wants you to find a suitable position such that the sum of land values covered by the capital is maximized.

Input Format

The first line contains three integers N,M,CN, M, C, denoting the height and width of the map and the side length of the capital.

The next NN lines each contain MM integers, giving the value of each plot on the map. Values may be negative.

Output Format

One line with two integers X,YX, Y, denoting the coordinates of the top-left corner of the capital. It is guaranteed that the optimal solution is unique.

3 4 2
1 2 3 1
-1 9 0 2
2 0 1 1

1 2

Hint

For 60%60\% of the testdata, N,M50N, M \le 50.

For 90%90\% of the testdata, N,M300N, M \le 300.

For 100%100\% of the testdata, 1N,M1031 \le N, M \le 10^3, 1Cmin(N,M)1 \le C \le \min(N, M). The absolute value of each tile's value does not exceed 3276732767.

Translated by ChatGPT 5