cf/mirror

Counting Rectangles is Fun

CF
372B1900· candidate master4s256 MB⌨ stdin/stdout

Examples

Sample 1of 2
Input
5 5 5
00101
00000
00001
01000
00001
1 2 2 4
4 5 4 5
1 2 5 2
2 2 4 5
4 2 5 3
Output
10
1
7
34
5
Sample 2of 2
Input
4 7 5
0000100
0000010
0011000
0000000
1 7 2 7
3 1 3 1
2 3 4 5
1 2 2 7
2 2 4 7
Output
3
1
16
27
52
372B.cpp
loading editor…
Ln 11·137 BGNU C++20 (64)