Logo
(追記) (追記ここまで)

27908번 - Kalendar 서브태스크다국어

시간 제한메모리 제한제출정답맞힌 사람정답 비율
1 초 1024 MB22513411060.440%

문제

Magdalena likes calendars, and she makes her own calendar for each month.

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

  • If the day number is single-digit, then it is represented as '..X'. For example, the number 7ドル$ is represented as '..7'
  • If the day number is double-digit, then it is represented as '.XY'. For example, the number 17ドル$ is represented as '.17'.

Each row of the calendar represents a week, and each week consists of 7ドル$ days. If the week doesn’t have all the 7ドル$ days (because the month doesn’t start on Monday, or it doesn’t end on Sunday), then the missing days are replaced with '...'.

Magdalena also wants her calendar to be pretty. She will decorate it in the following way: she will fill the upper and lower sides with '-' (ASCII 45), the left and right sides with '|' (ASCII 124), and the corners with '+' (ASCII 43).

For example, the format of Magdalena’s calendar, when the month has 31 days and starts on Wednesday, is the following:

+–––––––––––––––––––––+
|........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......|
+–––––––––––––––––––––+

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, and if $x = 5,ドル it starts on Friday.

Note: We assume the first day of the week is Monday.

입력

The first and only line contains integers $n$ and $d$ (1ドル ≤ n ≤ 99,ドル 1ドル ≤ d ≤ 7$), the number of days in the month, and the day it starts with.

출력

Print Magdalena’s calendar.

제한

서브태스크

번호배점제한
17

All the days will fit in a row.

219

$d = 1$

324

No additional constraints.

예제 입력 1

31 3

예제 출력 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......|
+---------------------+

예제 입력 2

1 5

예제 출력 2

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

예제 입력 3

28 7

예제 출력 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...|
+---------------------+

힌트

Clarification of the second example: Note that, although there is only one day in the month, the calendar still has the format of seven days per row.

출처

Contest > Croatian Open Competition in Informatics > COCI 2022/2023 > Contest #5 1번

채점 및 기타 정보

  • 예제는 채점하지 않는다.
(追記) (追記ここまで)

출처

대학교 대회

  • 사업자 등록 번호: 541-88-00682
  • 대표자명: 최백준
  • 주소: 서울시 서초구 서초대로74길 29 서초파라곤 412호
  • 전화번호: 02-521-0487 (이메일로 연락 주세요)
  • 이메일: contacts@startlink.io
  • 통신판매신고번호: 제 2017-서울서초-2193 호

AltStyle によって変換されたページ (->オリジナル) /