eolymp
bolt
Try our new interface for solving problems

House

Peter moved into the private property the land of size $m$ squares from north to south and $n$ squares from west to east. On this land he decided to build a house with size $a$ squares from north to south and $b$ squares from west to east. Some squares are radioactive, and Peter does not want to build the house on them. In addition, Peter wants the distance from the walls of the house to the boundaries of the land be expressed with an integer number of squares. For a long time he was choosing a place for the house, but did not choose - too many possibilities exist. But how many? He begin to count --- but couldn't because he was bad at math. Help him. \InputFile Initially given the values of $m, n, a, b, k~(1 \le a \le m \le 5000, 1 \le b \le n \le 5000, 0 \le k \le m \cdot n)$, where $m, n$ are the sizes of the land, $a, b$vare the sizes of the house, and $k$ is the number of radioactive squares. Then $k$ different pairs of integers $i, j~(1 \le i \le m, 1 \le j \le n)$ are given, that define the coordinates of radioactive squares. \OutputFile Print the number of possibilities to build the house.
Time limit 1 second
Memory limit 256 MiB
Input example #1
5 7 2 4 3
2 5 3 3 3 6
Output example #1
5
Input example #2
4 4 2 2 6
1 1 1 3 2 2 2 4 3 4 4 1
Output example #2
1
Author Непомнящий Григорий
Source Турнир Чемпионов, Винница 2010