P9177 [COCI 2022/2023 #5] Kalendar
Description
Magdalena likes calendars, and she makes her own calendar for each month.
Each day of the month is represented using exactly three characters:
- If the day number has one digit, it is written as `..X`. For example, the number $7$ is written as `..7`.
- If the day number has two digits, it is written as `.XY`. For example, the number $17$ is written as `.17`.
Each row of the calendar represents one week, and each week has $7$ days. If a week does not contain all $7$ days (because the month may not start on Monday, or may not end on Sunday), then the missing days are shown as `...`.
Magdalena also wants her calendar to look nice. She will decorate it in the following way:
she will fill the top and bottom with `-` (ASCII 45), the left and right sides with `|` (ASCII 124), and the four corners with `+` (ASCII 43).
Your task is to determine the format of Magdalena's calendar if 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 Monday; if $x=5$, it starts on Friday.
We assume that the first day of the week is Monday.
Input Format
One line containing integers $n$ and $x(1\leq n\leq 99,1\leq x\leq 7)$, representing the number of days in the month and the weekday on which the month starts.
Output Format
Output what Magdalena's calendar looks like.
Explanation/Hint
| Subtask | $pts$ | Constraints |
| :----------: | :----------: | :----------: |
| $0$ | $0$ | This is the sample. |
| $1$ | $7$ | $n+x\leq 8$ |
| $2$ | $19$ | $x=1$ |
| $3$ | $24$ | None. |
Translated by ChatGPT 5