题目描述
Problem Description
This problem is translated from JOI 2017 Final T4「サッカー / Soccer」
The assumption "the ball can pass through other players" is added for rigor under the condition that the data is not modified. If the ball stops upon hitting another player, the approach might be different.
You are the manager of a prestigious soccer club in the JOI league.
The club has $N$ players, numbered from $1$ to $N$. The players train diligently every day, aiming for the league championship. The soccer field can be considered as a rectangle with a base of $W$ meters and a height of $H$ meters, where the base is parallel to the east-west direction and the height is parallel to the north-south direction. A point can be represented by coordinates $(i, j)$ if moving $i$ meters north and $j$ meters west from that point brings you to the northwest corner of the field.
After practice, you need to retrieve the practice ball. At the start of retrieval, all players are on the field, with player $i (1 \leqslant i \leqslant N)$ located at $(S_i, T_i)$, and the ball is with player $1$. You are standing with player $N$ at $(S_N, T_N)$ and are ready to retrieve the ball. You will retrieve the ball only when it is passed to $(S_N, T_N)$.
You can command the players, but certain actions will increase their fatigue. A player cannot perform multiple actions simultaneously. You can command the player with the ball to perform the following actions:
* Kick the ball. Choose one of the four cardinal directions and specify a positive integer $p$. The player kicks the ball exactly $p$ meters in the chosen direction. Assume the ball can pass through other players. The player does not move and automatically stops controlling the ball, with fatigue increasing by $A \times p + B$.
* Dribble. Choose one of the four cardinal directions. The player moves with the ball one meter in the chosen direction. The player continues to control the ball, with fatigue increasing by $C$.
* Stop controlling the ball. The player's fatigue does not change.
You can command a player without the ball to perform the following actions:
* Move. Choose one of the four cardinal directions. The player moves one meter in the chosen direction, with fatigue increasing by $C$.
* Control the ball. The player can only control the ball if they are at the exact location of the ball and no other player is controlling it. The player's fatigue does not change.
Players and the ball can go out of bounds, and multiple players can be at the same location. After a day of intense training, the players are very tired. You want to know the minimum total fatigue increase for all players during the ball retrieval process.
Input Format
The first line contains two integers $H$ and $W$, separated by a space.
The second line contains three integers $A$, $B$, and $C$, separated by a space.
The third line contains one integer $N$.
The next $N$ lines, the $i$-th line $(1 \leqslant i \leqslant N)$ contains two integers $S_i$ and $T_i$, separated by a space.
All numbers are as described in the problem statement.
Output Format
One line containing one integer, representing the minimum total fatigue increase for all players during the ball retrieval process.
Sample Input and Output
Sample Input #1
6 5
1 3 6
3
1 1
0 4
6 5
Sample Output #1
26
Sample Input #2
3 3
0 50 10
2
0 0
3 3
Sample Output #2
60
Sample Input #3
4 3
0 15 10
2
0 0
4 3
Sample Output #3
45
Sample Input #4
4 6
0 5 1000
6
3 1
4 6
3 0
3 0
4 0
0 4
Sample Output #4
2020
Notes/Hints
Sample Explanation 1
In this sample, the field, players, and ball are in the following state. The black framed empty circles represent players, the filled circle represents the ball, and you are at $(6,5)$.

The optimal solution is as follows:
1. Player $1$ kicks the ball $3$ meters east. Fatigue increases by $1 \times 3 + 3 = 6$, and the ball moves to $(1,4)$.
2. Player $2$ moves $1$ meter south. Fatigue increases by $6$.
3. Player $2$ takes control of the ball.
4. Player $2$ dribbles $1$ meter east. Fatigue increases by $6$.
5. Player $2$ kicks the ball $5$ meters south, fatigue increases by $1 \times 5 + 3 = 8$, and the ball moves to $(6,5)$.
The total fatigue is $6 + 6 + 6 + 8 = 26$. There is no better solution.

Sample Explanation 2
In the optimal solution, no kicking is needed.
Sample Explanation 4
Note that in this sample, multiple players can be at the same location.
Data Range and Hints
For $5\%$ of the data, $N = 2$.
For another $30\%$ of the data, $N \leqslant 1000, A = 0$.
For all data, $1 \leqslant H, W \leqslant 500, 0 \leqslant A, B, C \leqslant 10^9, 2 \leqslant N \leqslant 10^5, 0 \leqslant S_i \leqslant H, 0 \leqslant T_i \leqslant W (1 \leqslant i \leqslant N), (S_1, T_1) \neq (S_N, T_N)$.
输入格式
见题面 Input 部分
输出格式
见题面 Output 部分