cf/mirror

Fools and Foolproof Roads

CF
362D2100· master1s256 MB⌨ stdin/stdout

Examples

Sample 1of 3
Input
9 6 2 2
1 2 2
3 2 1
4 6 20
1 3 8
7 8 3
5 7 2
Output
YES
9 5
1 9
Sample 2of 3
Input
2 0 1 2
Output
NO
Sample 3of 3
Input
2 0 0 2
Output
YES
362D.cpp
loading editor…
Ln 11·137 BGNU C++20 (64)
loading graph engine…