ICPC 2022 Online Challenge powered by HUAWEI - Problem 1


GP1. Optimal Graph Partition for Fast Routing (GP1)
time limit per test: 4 seconds
memory limit per test: 512 megabytes
input: standard input
output: standard output

Examples
Input
4 4
0 1 10
2 3 12
0 2 2
2 1 1
Output
3
1 0
2 1 2
1 3
Input
4 4
0 1 1100
2 3 1120
0 2 1020
2 1 1010
Output
3
1 0
2 1 2
1 3
----------------------------------------------------------------------------------------------------
GP2. Optimal Graph Partition for Fast Routing (GP2)
time limit per test: 5 seconds
memory limit per test: 512 megabytes
input: standard input
output: standard output

Examples
Input
4 4
0 1 10
2 3 12
0 2 2
2 1 1
4 0
0
1
2
3
Output
2
2 0 1
2 2 3
Input
4 4
0 1 10
2 3 12
0 2 2
2 1 1
4 2.3
0
1
2
3
Output
2
2 0 1
2 2 3
----------------------------------------------------------------------------------------------------
