You live in a small town withRbidirectional roads connectingCcrossings and you want togofrom crossing 1 to crossingCas soon as possible. You can visit other crossings before arriving at crossing C, but it’s not mandatory.
You haveexactly onechance to ask your friend to repair exactly one existing road,from the time youleavecrossing 1. If he repairs thei-th road fortunits of time, the crossing time after that would beviai-t. It's not difficult to see that it takesviunits of time to cross thatroad if your friend doesn’t repair it.
You cannot start to cross the road when your friend is repairing it.
3 2 1 2 1.5 1.8 2 3 2.0 1.5 2 1 1 2 2.0 1.8 0 0
2.589 1.976