#2744. [EC Final 2020] Rectangle Flip 2
[EC Final 2020] Rectangle Flip 2
[EC Final 2020] Rectangle Flip 2
题目描述
Prof. Pang enters a trap room in a dungeon. The room can be represented by an $n$ by $m$ chessboard. We use $(i, j)$ ($1\le i\le n$, $1\le j\le m$) to denote the cell at the $i$-th row and $j$-th column. Every second, the floor of one cell breaks apart (so that Prof. Pang can no longer stand on that cell.) After $nm$ seconds, there will be no cell to stand on and Prof. Pang will fall through to the next (deeper and more dangerous) level.But Prof. Pang knows that calm is the key to overcome any challenge. So instead of being panic, he calculates the number of rectangles such that every cell in it is intact (i.e., not broken) after every second. (A rectangle represented by four integers and () includes all cells such that . There are rectangles in total.)
输入格式
The first line contains two integers $n$, $m$ ($1\le n, m\le 500$) separated by a single space.The -th line contains two integers , separated by a single space representing that the cell breaks apart at the -th second. It is guaranteed that each cell appears exactly once in the input.
输出格式
Output $nm$ lines. The $i$-th line should contain the number of rectangles such that every cell in it is intact after the first $i$ cells break apart.2 2
1 1
2 1
1 2
2 2
5
3
1
0