You live in a small town with R bidirectional roads connecting C crossings and you want to go from crossing 1 to crossing C as soon as possible. You can visit other crossings before arriving at crossing C, but it’s not mandatory.
You have exactly one chance to ask your friend to repair exactly one existing road, from the time you leave crossing 1. If he repairs the i-th road for t units of time, the crossing time after that would be v_{i}a_{i}^{-t}. It's not difficult to see that it takes v_{i} units of time to cross that road 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
无
湖南省第六届大学生计算机程序设计竞赛