The Shortest Path in Nya Graph

HDU - 4725