cf/mirror

Euclid's nightmare

CF
1466F2100· master2s256 MB⌨ stdin/stdout

Examples

Sample 1of 3
Input
3 2
1 1
1 2
2 2 1
Output
4 2
1 2
Sample 2of 3
Input
2 3
2 1 3
2 1 2
Output
4 2
1 2
Sample 3of 3
Input
3 5
2 1 2
1 3
1 4
Output
8 3
1 2 3
1466F.cpp
loading editor…
Ln 11·137 BGNU C++20 (64)
loading graph engine…