1694: 蚂蚁寻路

Memory Limit:512 MB Time Limit:10.000 S
Judge Style:Text Compare Creator:
Submit:1 Solved:1

Description

Input

在输入文件 ant.in 中,第一行三个数 n,m,k。意义如题目描述。 接下来一个 n 行 m 列的整数矩阵,表示棋盘。

Output

在输出文件 ant.out 中,一个数,表示蚂蚁所走路径围出的图形可能的最大权 值和。

Sample Input Copy

2 5 2
-1 -1 -1 -1 -1
-1 -1 -1 -1 -1

Sample Output Copy

-8

HINT