#P2331. [SCOI2005] 最大子矩阵

    ID: 1308 远端评测题 1000ms 125MiB 尝试: 0 已通过: 0 难度: 7 上传者: 标签>动态规划,dp递推2005四川各省省选前缀和

[SCOI2005] 最大子矩阵

Description

There is an n×mn \times m matrix. Please choose kk submatrices so that the sum of their scores is maximized.

Note: The chosen kk submatrices must be pairwise non-overlapping (no two share any cell).

Input Format

The first line contains n,m,kn, m, k. Each of the next nn lines contains mm integers, the scores of the elements in the matrix. The absolute value of each element’s score does not exceed 3276732767.

Output Format

Output a single line containing the maximum possible sum of the scores of the kk submatrices.

3 2 2
1 -3
2 3
-2 3

9

Hint

For 100%100\% of the testdata, 1n1001 \leq n \leq 100, 1m21 \leq m \leq 2, 1k101 \leq k \leq 10.

Translated by ChatGPT 5