cf/mirror

Another Exercise on Graphs (hard version)

CF
2057E22500· grandmaster3s1024 MB⌨ stdin/stdout

Examples

Sample 1of 1multi-test • hover to link
Input
3
4 4 2
1 2 2
2 4 2
1 3 4
3 4 1
1 4 2
2 3 1
6 7 3
1 2 10
2 3 3
3 4 9
4 5 2
5 6 1
2 4 10
4 6 10
1 6 3
1 6 2
2 4 1
11 17 10
1 4 5
1 3 19
1 2 10
3 2 13
4 5 1
4 6 11
3 5 9
3 6 18
2 7 17
5 8 15
5 10 8
6 9 4
7 10 20
7 8 16
8 11 3
9 11 6
10 11 14
3 11 1
3 11 3
1 11 1
1 11 4
1 11 3
8 2 2
10 4 1
3 9 2
3 9 1
6 7 3
Output
1 2
2 9 9
11 3 11 1 3 10 8 4 11 4
2057E2.cpp
loading editor…
Ln 11·137 BGNU C++20 (64)
loading graph engine…