sibice | 프로그래밍의 벗 PivotOJ
PivotOJ

sibice

시간 제한: 1000ms메모리 제한: 128MB출처: CHC 2006 Regional Competition - SeniorsBOJ 3160

문제

24 matches are arranged to form a 3x3 grid as illustrated in the figure below. 

+--+--+--+ 
|..|..|..| 
|..|..|..| 
+--+--+--+ 
|..|..|..| 
|..|..|..| 
+--+--+--+ 
|..|..|..| 
|..|..|..| 
+--+--+--+ 

Two consecutive '-' (minus) characters represent a horizontal match, whereas two consecutive '|' (vertical bar) characters represent a vertical match. '+' (plus) characters represent positions where two or more matches' ends touch. The interior of the board is filled with '.' (dot) characters. 

Write a program that, given integers N and K, removes exactly N matches in such a way that the remaining matches form exactly K squares and that each remaining match is part of some square. 

입력

The first and only line of input contains two integers N and K, 1 ≤ N < 24, 1 ≤ K < 14, the number of matches to be removed and the number of squares wanted. 

출력

Output the resulting board in a format identical to the figure from the task description, with dot characters in place of the removed matches. 

Note: the test data will be such that a solution, although not necessarily unique, always exists. 

예제

예제 1

입력
20 1
출력
+--+..+..+
|..|......
|..|......
+--+..+..+
..........
..........
+..+..+..+
..........
..........
+..+..+..+

예제 2

입력
5 4
출력
+--+--+--+
|..|..|..|
|..|..|..|
+--+--+..+
|.....|..|
|.....|..|
+--+--+..+
|........|
|........|
+--+--+--+

예제 3

입력
4 6
출력
+--+--+--+
|..|..|..|
|..|..|..|
+--+--+..+
|..|..|..|
|..|..|..|
+--+--+..+
|........|
|........|
+--+--+--+
이 문제는 채점 준비 중입니다. 테스트 데이터가 확보되면 제출이 가능합니다.