#P12561. [UTS 2024] Matrix
[UTS 2024] Matrix
题目描述
You are given a matrix of size consisting of elements .
We call a triangle on the matrix of size starting at point a set of points that can be reached from in no more than steps going either up or right.
You are asked to find for each the following values:
- The maximal value in the triangle of size starting at point ;
- The number of occurrences of the maximal value in that triangle.
输入格式
The first line contains three integers , , and --- dimensions of the matrix and the size of the triangle.
The following lines contain integers --- description of the matrix.
输出格式
Print two matrices of size .
The first matrix in position should contain the maximal value of a triangle of size starting at .
The second matrix in position should contain the number of occurrences of the maximal value in the triangle of size starting at .
4 4 2
1 2 6 14
12 3 13 5
11 4 7 8
10 16 9 15
12 13 13
12 7 13
16 16 15
1 1 1
1 1 1
1 1 1
提示
- ( points) ;
- ( points) ;
- ( points) ;
- ( points) ;
- ( points) no additional restrictions.