Problem T
Flatland Olympics

Since this morning e-mails have been filling up your inbox,
containing complaints about obscured views during the most
important race: the
Since you expect that a greater number of visitors will be allowed to spectate at the next Olympic games, you assume that there will be even more complaints if you do not address this issue. If the situation will be too bad, you may even lose your sponsor Dy & Son. Therefore, you decide to count the number of complaints beforehand. To do this, you model the running track as a straight line segment, and count the maximal number of complaints you could get based on the seating of the visitors. Depending on the number of complaints you expect, you will determine if you need to rework the seating or just reconfigure your spam blocker and try to find a new sponsor.
Input
The input consists of:
-
One line containing four integers
, , and , where is the starting point of the running track and is the end point of the running track. Both and belong to the running track. -
One line containing an integer
, the number of visitors. -
lines, each containing two integers and , where is the location of the seat of a visitor.
It is guaranteed that the track has a positive length, i.e.
Output
Output the total number of complaints that you would receive for the given seating.
![\includegraphics[width=0.7\textwidth ]{sample2}](/problems/flatlandolympics/file/statement/en/img-0002.png)
Sample Input 1 | Sample Output 1 |
---|---|
0 0 100 0 4 50 20 50 30 50 50 120 0 |
3 |
Sample Input 2 | Sample Output 2 |
---|---|
0 0 100 0 5 50 20 50 30 50 -20 50 -30 100 30 |
2 |