Problem Description (,, ~ ),, (, ^0^ ),,,.,,,,,,.,,,,,. Because the home is on a city, there's no train passing, so she can only go to the nearby city.
Input There are multiple sets of input data, the first line of each group is three integer t, s and d, which indicates that there's a t, and the
Then there are three lines, each line has three integer a, b, time, representing a, b city between the drive is the time hour; ( 1 = <( a, b ) <= 1000; a, there may be multiple paths between b.
And then the number of s + 1 lines, which represents the city connected to the grass.
And then the number of d + 2 lines of the line, which indicates the.
Output And the output to a of the city.
6 2 3
1 3 5
1 4 7
2 8 12
3 8 4
4 9 12
9 10 2
8 9 10
Sample Output 9 Solve the problem: A problem, the data range of the question is a bit, in the case of 1000,, but the data isn't the worst case, that's, the. Here's the 202ms, and the time is, and if you use, it should be less. Code: