atcoder#ARC061B. [ABC045D] すぬけ君の塗り絵
[ABC045D] すぬけ君の塗り絵
Score : points
Problem Statement
We have a grid with rows and columns. At first, all cells were painted white.
Snuke painted of these cells. The -th ( ) cell he painted is the cell at the -th row and -th column.
Compute the following:
- For each integer ( ), how many subrectangles of size of the grid contains exactly black cells, after Snuke painted cells?
Constraints
Input
The input is given from Standard Input in the following format:
:
Output
Print lines. The -th ( ) line should contain the number of the subrectangles of size of the grid that contains exactly black cells.
4 5 8
1 1
1 4
1 5
2 3
3 1
3 2
3 4
4 4
0
0
0
2
4
0
0
0
0
0
There are six subrectangles of size . Two of them contain three black cells each, and the remaining four contain four black cells each.
10 10 20
1 1
1 4
1 9
2 5
3 10
4 2
4 7
5 9
6 4
6 6
6 7
7 1
7 3
7 7
8 1
8 5
8 10
9 2
10 4
10 9
4
26
22
10
2
0
0
0
0
0
1000000000 1000000000 0
999999996000000004
0
0
0
0
0
0
0
0
0