Problems
Farmer John has decided his home needs more decoration. Visiting the local china shop, he finds a delicate glass cow figurine that he decides to purchase, knowing that it will fit perfectly on the mantel above his fireplace.
The shape of the cow figurine is described by an
...............
...............
...............
#..#...........
####...........
############...
.##.#########..
....#######.##.
....##...##....
....##...##....
...............
...............
...............
...............
...............Unfortunately, right before FJ can make his purchase, a bull runs through the shop and breaks not only FJ's figurine, but many of the other glass objects on the shelves as well! FJ's figurine breaks into 2 pieces, which quickly become lost among
Please help FJ determine which of the
FJ can shift a piece both vertically and/or horizontally by any number of characters, but it cannot be shifted so far that any of its '#' characters fall outside the original
Input
The first line of input contains
The next
The next
Output
다음 줄에 공백으로 구분된 두 개의 정수를 출력하십시오. 각 정수는 1부터 K 사이의 값이어야 하며, FJ의 모형을 이루는 두 조각의 인덱스를 나타냅니다.
해결책은 항상 존재하며, 유일합니다. 출력하는 두 숫자는 오름차순으로 정렬되어야 합니다.
Example
4 3
####
#..#
#.##
....
.#..
.#..
##..
....
####
##..
#..#
####
....
.###
.#..
.#..
1 3