cf/mirror

Magic Tricks

CF
1346E1700· expert2s256 MB⌨ stdin/stdout

Examples

Sample 1of 3
Input
4 5 1
3 4
2 1
4 1
3 1
3 1
Output
2 0 3 1
Sample 2of 3
Input
5 7 4
3 2
3 2
4 2
3 4
4 1
3 2
5 2
Output
2 2 0 3 1
Sample 3of 3
Input
7 15 5
5 3
4 2
6 1
2 4
1 6
3 7
5 6
4 2
6 4
2 6
6 3
6 3
7 6
2 6
7 2
Output
-1 1 1 1 2 1 0
1346E.cpp
loading editor…
Ln 11·137 BGNU C++20 (64)
loading graph engine…