Hello, Pie!
Pizzeria Pizazz prides itself on delivering pizza to its customers as fast as possible. Unfortunately, only one driver can be hired for delivery. Before delivery, he waits until a certain number of orders arrive (from to ). The driver prefers to choose the fastest route for delivering all orders, even if he has to pass the same place several times, including a pizzeria. At the end of the delivery, the driver must return to the original place, that is, to the pizzeria. You need to write a program that finds such a route.
Input
The first line contains the number of orders . This is followed by strings, each containing integers. These numbers indicate the travel time between the pizzeria (its number is ) and places where orders are located (they are numbered from to ). The - th value of the - th line indicates the time it takes to drive directly from the location to the location , without visiting any other places along the way. Note that travel between and may not be faster directly, but through other locations due to traffic jams and traffic lights. Travel times are not symmetrical. That is, the time it takes to drive directly from to does not always coincide with the travel time directly from to .
Output
Print one number — the shortest time it takes to deliver pizza to all customers and return back to pizzeria.