2 6 2 5
14 Let us name the travelers A and B. Also, call the $i$\-th rest area simply rest area $i$. Here is a possible trip. At the beginning, A starts at rest area $1$ walking to the east, and B starts at rest area $2$ walking to the east, both at a speed of $1$, planning to visit the east end first and then the west end. Then, two seconds later, B is back at rest area $2$ after visiting the east end, but A is still halfway between rest areas $1$ and $2$. If B rests here for one second, A will also arrive at rest area $2$, where they can pass each other. Afterward, if they continue to walk at a speed of $1$ and A rests at rest area $1$ for two seconds, B will be back at the starting rest area at time $13$, and A will be back at time $14$, completing the trip. This trip turns out to be optimal: the answer is $14$.
2 3 1 2
6 In this case, an optimal trip will allow both travelers to keep walking at a speed of $1$ without resting.
{
"problem": {
"name": "Pass on Path",
"description": {
"content": "There is a narrow straight road of length $L$ stretching east to west. Two travelers will visit this road. Along the road, there are $N$ rest areas. The distance from the west end of the road to the $",
"description_type": "Markdown"
},
"platform": "AtCoder",
"limit": {
"time_limit": 2000,
"memory_limit": 262144
},
"difficulty": "None",
"is_remote": true,
"is_sync": true,
"sync_url": null,
"sign": "arc152_b"
},
"statements": [
{
"statement_type": "Markdown",
"content": "There is a narrow straight road of length $L$ stretching east to west. Two travelers will visit this road. Along the road, there are $N$ rest areas. The distance from the west end of the road to the $...",
"is_translate": false,
"language": "English"
}
]
}