Type: Default 1000ms 256MiB

Grid

You cannot submit for this problem because the contest is ended. You can click "Open in Problem Set" to view this problem in normal mode.

Background

先预祝各位卷王期末取得好成绩!!!

Description

在一个NNMM列的网格中,每个格子都填充了任意一个数字A(1<=A<=MAX)A(1<=A<=MAX),现在你需要对每一对(k,l)(0<=k<=Nn,0<=l<=Mm)(k,l)(0<=k<=N-n,0<=l<=M-m)求出在以k+1,l+1k+1,l+1为左上角,k+n,l+mk+n,l+m为右下角的矩阵有多少个不同的数

Format

Input

第一行,分别是N,M,MAX,n,mN,M,MAX,n,m

接下来NN行,每行MM个数,代表相应网格内填充的数字

Output

ansk,lans_{k,l}表示矩阵左上角为kkll时的答案

那么输出格式为

ans1,1 ans1,2 ...... ans1,Mm+1ans_{1,1}~ans_{1,2}~......~ans_{1,M-m+1}

ans2,1 ans2,2 ...... ans2,Mm+1ans_{2,1}~ans_{2,2}~......~ans_{2,M-m+1}

..

..

..

$ans_{N-n+1,1}~ans_{N-n+1,2}~......~ans_{N-n+1,M-m+1} $

Samples

3 4 5 2 2
2 2 1 1
3 2 5 3
3 4 4 3
4 4 3
5 3 4

Limitation

1N,M,MAX300 1 \le N,M,MAX \le 300\\ 1nN 1 \le n \le N\\ 1mM1 \le m \le M\\

新生周赛第七场(DIV. 3)

Not Attended
Status
Done
Rule
IOI
Problem
6
Start at
2022-12-25 19:30
End at
2022-12-25 21:30
Duration
2 hour(s)
Host
Partic.
35