cf/mirror

Mashmokh's Designed Problem

CF
414E3200· legendary gm4s512 MB⌨ stdin/stdout

Examples

Sample 1of 2
Input
4 9
1 2
1 3
1 4
0
1 1 4
2 4 2
1 3 4
3 1
3 2
2 3 2
1 1 2
3 1
3 2
Output
3
2
2
4
1
3
4
Sample 2of 2
Input
2 2
1 2
0
1 2 1
3 1
Output
1
2
414E.cpp
loading editor…
Ln 11·137 BGNU C++20 (64)