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

25088번 - Punched Cards 서브태스크다국어

시간 제한메모리 제한제출정답맞힌 사람정답 비율
5 초 (추가 시간 없음) 1024 MB24521319188.018%

문제

A secret team of programmers is plotting to disrupt the programming language landscape and bring punched cards back by introducing a new language called Punched Card Python that lets people code in Python using punched cards! Like good disrupters, they are going to launch a viral campaign to promote their new language before even having the design for a prototype. For the campaign, they want to draw punched cards of different sizes in ASCII art.

The ASCII art of a punched card they want to draw is similar to an $R×C$ matrix without the top-left cell. That means, it has $(R⋅C)-1$ cells in total. Each cell is drawn in ASCII art as a period (.) surrounded by dashes (-) above and below, pipes (|) to the left and right, and plus signs (+) for each corner. Adjacent cells share the common characters in the border. Periods (.) are used to align the cells in the top row.

For example, the following is a punched card with $R=3$ rows and $C=4$ columns:

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

There are more examples with other sizes in the samples below. Given the integers $R$ and $C$ describing the size of a punched card, print the ASCII art drawing of it as described above.

입력

The first line of the input gives the number of test cases, $T$. $T$ lines follow, each describing a different test case with two integers $R$ and $C$: the number of rows and columns of the punched card that must be drawn.

출력

For each test case, output one line containing Case #x:, where $x$ is the test case number (starting from 1). Then, output $(2⋅R)+1$ additional lines with the ASCII art drawing of a punched card with $R$ rows and $C$ columns.

제한

Test Set 1 (11점)

  • 1ドル≤T≤81$.
  • 2ドル≤R≤10$.
  • 2ドル≤C≤10$.

예제 입력 1

3
3 4
2 2
2 3

예제 출력 1

Case #1:
..+-+-+-+
..|.|.|.|
+-+-+-+-+
|.|.|.|.|
+-+-+-+-+
|.|.|.|.|
+-+-+-+-+
Case #2:
..+-+
..|.|
+-+-+
|.|.|
+-+-+
Case #3:
..+-+-+
..|.|.|
+-+-+-+
|.|.|.|
+-+-+-+

힌트

Sample Case #1 is the one described in the problem statement. Sample Cases #2 and #3 are additional examples. Notice that the output for each case contains exactly $R⋅C+3$ periods.

출처

Contest > Google > Code Jam > Google Code Jam 2022 > Qualification Round A번

채점 및 기타 정보

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

출처

대학교 대회

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

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