Word Search
시간 제한2초메모리 제한1024 MB
작은 2차원 격자 패턴이 큰 격자 안에서 나타나는 모든 위치를 찾아, 일치하는 칸은 원래 문자를 남기고 나머지는 마침표로 바꿔 출력한다.
문제
Find parts of a 2d grid matching a 2d word.
입력
- One line containing the number of rows and columns in the search key, and ().
- further lines, each containing Latin characters comprising a row of the search key.
- One line containing the number of rows and columns in the haystack, and (, ).
- further lines, each containing Latin characters comprising a row of the search key.
출력
Illustrate the matching areas of the haystack by printing a grid of the same size. In locations that are part of at least one match, print the original character from the haystack. In other cases, print a full-stop "." character.