cf/mirror

Submatrices

CF
1533H3.5s256 MB⌨ stdin/stdout

Examples

Sample 1of 3
Input
2 3
ABB
ABA
Output
9 9 0 0 0
Sample 2of 3
Input
6 6
EDCECE
EDDCEB
ACCECC
BAEEDC
DDDDEC
DDAEAD
Output
56 94 131 103 57
Sample 3of 3
Input
3 10
AEAAEEEEEC
CEEAAEEEEE
CEEEEAACAA
Output
78 153 99 0 0
1533H.cpp
loading editor…
Ln 11·137 BGNU C++20 (64)