Alice and Bob are driving on a very long road that stretches from points to . Alice starts at point while Bob starts at point . There are events to visit, where event is at position . Either Alice or Bob must visit each event, but they must be visited (they must visit event , then event , then event , then event ).
Find the minimum distance Alice and Bob can drive to visit all events.
输入格式
The first line contains a single integer () --- the number of events.
The second line contains two integers and () --- Alice and Bob's starting points.
The third line contains integers () --- the locations of events either Alice or Bob must get to.
输出格式
Output an integer --- the minimum total distance Alice and Bob drive.
样例
样例输入 1
5
2 3
5 1 4 4 7
样例输出 1
7
样例输入 2
6
540 152
450 600 532 496 325 336
样例输出 2
526
样例输入 3
8
35 315
-406 -543 114 205 -840 161 540 -731
样例输出 3
1699
数据范围与提示
Note
In the first example:
Bob moves from position to position to attend event , driving units.
Alice moves from position to position to attend event , driving unit.
Bob moves from position to position for event , driving unit.
Bob stays at position , attending event , driving units.
Bob moves from position to position for event , driving units.