#P1354. 房间最短路问题
房间最短路问题
Description
In a room with both length and width equal to , with the entrance and exit at and respectively, there are several walls, each with two gaps. Find the shortest path from the entrance to the exit.

Input Format
The first line contains (), the number of walls.
The next lines each contain real numbers .
is the -coordinate of the wall (all walls are vertical). The segments between and are openings.
are in increasing order, and are also in increasing order.
Output Format
Output the shortest distance, keeping decimal places.
2
4 2 7 8 9
7 3 4.5 6 7
10.06
Hint
Translated by ChatGPT 5
京公网安备 11011102002149号