Blocking Crosses
시간 제한2초메모리 제한512 MB
r×c 격자에 겹치지 않는 십자 모양을 배치해, 새 십자를 놓거나 기존 십자를 한 칸 밀 수 없도록 만든다.
문제
Consider a flat rectangular field consisting of squares. A cross is a figure consisting of five squares: a center squares and its four neighbors, horizontal and vertical.
A placement of crosses on the field is a collection of crosses which satisfies the following conditions:
- Each cross lies entirely inside the field.
- No two crosses have a common square.
A placement is blocking when additional conditions are satisfied:
- There is no place on the field such that a new cross can be added there, and the collection of crosses remains a placement.
- There is no cross on the field which can be moved as a whole, one square to the right, left, up, or down, so that the collection of crosses remains a placement.
Given the dimensions of the field, find any blocking placement of crosses on it.
입력
The first line of input contains two integers and : the number of rows and columns on the field ().
출력
Print lines, each containing characters: any placement of crosses which satisfies all the conditions. Empty squares are denoted by "." (dot, ASCII code 46). Centers of crosses are denoted by "+" (plus, ASCII code 43), horizontal parts by "-" (minus, ASCII code 45), and vertical parts by "|" (vertical line, ASCII code 124).