+Your program is to read from standard input. The input starts with a line containing two integers, 𝑁 and 𝑀(1 ≤ 𝑁 ≤ 20,000, 𝑁 − 1 ≤ 𝑀 ≤ 100,000), where 𝑁 and 𝑀 are the numbers of vertices and edges of 𝐺, respectively. The vertices of 𝐺 are represented by 1, 2, … , 𝑁. In each of the following 𝑀 lines, three integers 𝑎, 𝑏, and 𝑡 (1 ≤ 𝑎 ≠ 𝑏 ≤ 𝑁, 1 ≤ 𝑡 ≤ 10,000) are given, where an edge connects the two vertices 𝑎 and 𝑏, and its weight is 𝑡. The last (𝑀 + 2)-th line contains three integers 𝑢, 𝑣, and 𝑤, which are the initial locations ofthree robots (1 ≤ 𝑢, 𝑣, 𝑤 ≤ 𝑁). Of course, it is possible that at least two of the three robots are initially located on an identical vertex.
0 commit comments