Problems
Alan just had his first cryptography class in school today. He decided to apply what he
learned and come up with his own cipher. He will map each English letter
from A to Z to a decimal digit
In his excitement, Alan failed to notice that there are
Given a list of
Input
The first line of the input gives the number of test cases,
The first line of each test case contains
The second line of each test case contains
The
Output
For each test case, output one line containing Case #,
where YES,
if there is at least one pair of different words from the list whose encoding coincides, and
NO otherwise.
Example
2
0 1 2 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3
4
ABC
BC
BCD
CDE
0 1 2 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3
3
CDE
DEF
EFG
Case #1: NO
Case #2: YES