sibice
문제
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
+--+--+--+ |..|..|..| |..|..|..| +--+--+..+ |..|..|..| |..|..|..| +--+--+..+ |........| |........| +--+--+--+