PROBLEM LINKS
DIFFICULTY
EASY
EXPLANATION
This is the easiest problem of the set. If the length of the current string Bi is greater than or equal to 47, just print Good. In other case, iterate through all of the K favorite strings of the Little Elephant and check whether Bi is its substring using definition from the problem statement or using some built-in function of your programming language, for example, in C/C++ you can use magic function strstr(char * pattern, char * text) that do all the job (see tester solution as a reference). If Bi is appeared to be a substring of some favorite string, print Good, otherwise print Bad.
SETTER’S SOLUTION
Can be found here.
TESTER’S SOLUTION
Can be found here.