cf/mirror

Mahmoud and a Dictionary

CF
766D2000· candidate master4s256 MB⌨ stdin/stdout

Examples

Sample 1of 2
Input
3 3 4
hate love like
1 love like
2 love hate
1 hate like
love like
love hate
like hate
hate like
Output
YES
YES
NO
1
2
2
2
Sample 2of 2
Input
8 6 5
hi welcome hello ihateyou goaway dog cat rat
1 hi welcome
1 ihateyou goaway
2 hello ihateyou
2 hi goaway
2 hi hello
1 hi hello
dog cat
dog hi
hi hello
ihateyou goaway
welcome ihateyou
Output
YES
YES
YES
YES
NO
YES
3
3
1
1
2
766D.cpp
loading editor…
Ln 11·137 BGNU C++20 (64)
loading graph engine…