Matrix
时间限制:C/C++/Rust/Pascal 2秒,其他语言4秒
空间限制:C/C++/Rust/Pascal 512 M,其他语言1024 M
64bit IO Format: %lld

题目描述

You are given a matrix consists of rows and columns. We call the grid in the upper left corner as and call the grid in the bottom right corner as . Each grid contains an integer .
You can choose at most  grids. In addition, all grids except should be chosen before you choose . For example, if you want to choose , you should choose previously.
Your point is the sum of integers in the chosen grids, please calculate the maximum point you can get.

输入描述:

The first line contains three integers  denote the number of rows and columns of the matrix, and  denote the number of grids you can choose mostly.
Then lines follow, each line contains integers .

输出描述:

Output an integer representing the maximum point you can get.
示例1

输入

复制
3 3 4
2 1 2
1 3 1
2 1 1

输出

复制
7

说明

In the example, the following steps are a possible option that can get the maximum point.
In move 1_{} , you can only choose (1,1)_{} , and you choose (1,1)_{} .
In move 2_{} , you can choose (1,2)_{} or (2,1)_{} , and you choose (1,2)_{}
In move 3_{} , you can choose (1,3)_{} or (2,1)_{} , and you choose (2,1)_{}
In move 4_{} , you can choose (1,3)_{} or (2,2)_{} or (3,1)_{} , and you choose (2,2)_{}
So you can get 2+1+1+3=7_{} points.