December 4 - BMTK Programming School, High League

Vasya and matrix

Mother gave Vasya a rectangular matrix n by m. Each cell of the matrix contains one integer. Vasya played a lot of math games with it: he found its determinant and powered it into some degrees.

But such games made him a little tired, so he invented a new entertainment: he choose an integer k and tries to find a submatrix of maximal area with total sum of numbers in it not greater than k. The submatrix is a rectangular area of matrix.


The first line contains three integers n, m and k (1n, m300, 1k109).

Each of the next n lines contains m nonnegative integers, each no more than 1000.


Print the area of maximal submatrix, which sum of numbers is not greater than k.

Time limit 1 second
Memory limit 128 MiB
Input example #1
1 3 4
8 6 4
Output example #1
Input example #2
3 3 12
7 5 7
8 4 8
4 3 2
Output example #2