P29932 [洛谷] [COCI2022-2023#5] Kalendar
普及-
题目描述

Problem Description

Magdalena loves calendars and creates her own for each month.

Each day of the month is represented by exactly three characters:

  • If the day is a single digit, it is represented as ..X. For example, the number $7$ is represented as ..7.
  • If the day is a double digit, it is represented as .XY. For example, the number $17$ is represented as .17.

Each row of the calendar represents a week, consisting of $7$ days. If a week does not have all $7$ days (because the month might not start on a Monday or end on a Sunday), the missing days are represented by ....

Magdalena also wants her calendar to be aesthetically pleasing. She decorates it by adding - (ASCII 45) on the top and bottom, | (ASCII 124) on the left and right, and + (ASCII 43) in the four corners.

Your task is to determine the format of Magdalena's calendar given that it has $n$ days and the first day of the month is the $x$-th day of the week. For example, if $x=1$, the month starts on a Monday, and if $x=5$, it starts on a Friday.

We assume that the first day of the week is Monday.

Input Format

A single line containing two integers $n$ and $x$ $(1 \leq n \leq 99, 1 \leq x \leq 7)$, representing the number of days in the month and the starting day of the month, respectively.

Output Format

Output the appearance of Magdalena's calendar.

Sample Input and Output

Sample Input #1

31 3

Sample Output #1

+---------------------+
|........1..2..3..4..5|
|..6..7..8..9.10.11.12|
|.13.14.15.16.17.18.19|
|.20.21.22.23.24.25.26|
|.27.28.29.30.31......|
+---------------------+

Sample Input #2

1 5

Sample Output #2

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

Sample Input #3

28 7

Sample Output #3

+---------------------+
|....................1|
|..2..3..4..5..6..7..8|
|..9.10.11.12.13.14.15|
|.16.17.18.19.20.21.22|
|.23.24.25.26.27.28...|
+---------------------+

Notes

Subtask $pts$ Constraints
$0$ $0$ Sample cases
$1$ $7$ $n + x \leq 8$
$2$ $19$ $x = 1$
$3$ $24$ None
输入格式

见题面 Input 部分

输出格式

见题面 Output 部分

样例输入
31 3
样例输出
+---------------------+ |........1..2..3..4..5| |..6..7..8..9.10.11.12| |.13.14.15.16.17.18.19| |.20.21.22.23.24.25.26| |.27.28.29.30.31......| +---------------------+