cf/mirror

Boboniu Walks on Graph

CF
1394B2300· international master1s256 MB⌨ stdin/stdout

Examples

Sample 1of 3
Input
4 6 3
4 2 1
1 2 2
2 4 3
4 1 4
4 3 5
3 1 6
Output
2
Sample 2of 3
Input
5 5 1
1 4 1
5 1 2
2 5 3
4 3 4
3 2 5
Output
1
Sample 3of 3
Input
6 13 4
3 5 1
2 5 2
6 3 3
1 4 4
2 6 5
5 3 6
4 1 7
4 3 8
5 2 9
4 2 10
2 1 11
6 1 12
4 6 13
Output
1
1394B.cpp
loading editor…
Ln 11·137 BGNU C++20 (64)
loading graph engine…