아직 만들고 있는 페이지입니다.

이 페이지는 아직 만드는 중입니다. 보이는 내용은 바뀔 수 있습니다.

Blocking Crosses

시간 제한2초메모리 제한512 MB

요약
r×c 격자에 겹치지 않는 십자 모양을 배치해, 새 십자를 놓거나 기존 십자를 한 칸 밀 수 없도록 만든다.
난이도

보통10점 중 7점

유형
그리디, 구현, 시뮬레이션, 완전 탐색
정답자
아직 제출이 없습니다

문제

Consider a flat rectangular field consisting of r×cr \times c 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 rr and cc: the number of rows and columns on the field (10≤r,c≤10010 \le r, c \le 100).

출력

Print rr lines, each containing cc 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).

예제1

  1. 예제 1

    입력
    10 12
    
    예상 출력
    .|..|...|...
    -+--+-|-+-|.
    .|.||-+-|-+-
    .|-+-||..||.
    -+-|-+-|-+-.
    .||..|-+-|..
    .-+-|..||...
    .||-+-|-+-|.
    -+-.|-+-|-+-
    .|....|...|.