P11752 [AOJ] L Jumps
普及
题目描述

Example

Input

3 2 4 0
2 2
-2 -2
-2 2

Output

15

输入格式

见题面

输出格式

见题面

样例输入
3 2 4 0 2 2 -2 -2 -2 2
样例输出
15