Жишээ тэстүүд

Оролт
5 4 5
1 3
1 2
1 4
4 5
2 1 4 3
4 5 6
1 5 2
5 5 10
2 3 3
5 3 1
Гаралт
1 3
2 2 3
0
3 1 2 4
1 2

Тэмдэглэл

Graph of Andarz Gu in the sample case is as follows (ID of people in each city are written next to them):