grid_row followed by grid_col.word_size, which specifies how many target words there are.K target words.K strings separated by spaces: write Yes for each word that occurs and No for each one that does not.Input:
3 3
C A T
I D O
N O M
4
CAT TOM ADO MOM
Output:
Yes Yes Yes No
Input:
3 3
B E E
A R T
T O P
4
BAT POT BEE BOO
Output:
Yes Yes Yes No
Explanation: BAT runs down the first column, POT appears from right to left in the bottom row, BEE occupies the top row, while BOO cannot be found.