SP30669 ADATRIP - Ada and Trip

Description

Ada the Ladybug loves trips. She travels around world taking photos and souvenirs. This week she went to Buganda. Common Tourist would surely travel around main city and some conurbations, but Ada has different politics. She wants to go as far as possible (because photos from outlying places are much more valuable). Problem is, that Buganda is very large so she can barely guess such places. Luckily, you are around so she asked you for help. Can you tell her, how far and how many cities are most distant (if the shortest path is used)?

Input Format

The first line will contain three integers **1 , the number of cities in Buganda, the number of roads and number of queries (possible arrival cities).** Then **M** lines follow, with three integers **0 , **A, B** are cities, which the (bidirectional) road connets and **L** is length of the road.** Afterward, **Q** lines follow, each with number **0 , meaning the city of arival.** You are asured that **max(N,M)\*Q** will be always lesser/equal than **10 $ ^{7} $** **Gentle warning**: Since we are in real world and not in some "graph theory", multiedges and self-edges are completely valid!

Output Format

For each query print two numbers: The distance of most distant place(s) and number of such places.