cf/mirror

Hercule Poirot Problem

CF
46F2300· international master2s256 MB⌨ stdin/stdout

Examples

Sample 1of 2
Input
2 1 2
1 2
Dmitry 1 1 1
Natalia 2 0
Natalia 1 1 1
Dmitry 2 0
Output
YES
Sample 2of 2
Input
4 4 3
1 3
1 2
2 3
3 4
Artem 1 1 4
Dmitry 1 1 2
Edvard 4 2 1 3
Artem 2 0
Dmitry 1 0
Edvard 4 4 1 2 3 4
Output
NO
46F.cpp
loading editor…
Ln 11·137 BGNU C++20 (64)
loading graph engine…