15 teams scored 690 points on this task, for a maximum score of 100, an average score of 46 and a median score of 40.
William loves words. Today he is trying to come up with "pronounceable" words. What is a pronounceable word? Well, clearly "hello" is a pronounceable word, while "tqwukjt" is not. William defines a word as pronounceable if every one of its 3-character substrings is an acceptable trigram. In the example above, the "wuk" substring could be reasonably pronounced so it's indeed an acceptable trigram, "qwu" is a bit ugly but it could still pass, but then what about "tqw" and "kjt"? They are just too weird to say! To make things easy, William collected a list of all the K acceptable trigrams. With the hard part out of the way, now comes the easy stuff: generating the pronounceable words. William is asking for your help. He left a note where he detailed how he wants you to write a program that reads in the known trigrams and two numbers N and L, and then performs the following operations: (1) Calculate a list of all the pronounceable words that are exactly L-characters long...