#4626. [UTS 2024] Matrix
[UTS 2024] Matrix
[UTS 2024] Matrix
题目描述
You are given a matrix of size $n \times m$ consisting of elements $a_{i,j}$.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 $n$, $m$, and $k$ $(1 \le n,m \le 2\,000, 1 \le k \le \min(n,m))$ --- dimensions of the matrix and the size of the triangle.The following lines contain integers --- description of the matrix.
输出格式
Print two matrices of size $(n-k+1)\times(m-k+1)$.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