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

13240번 - Chessboard 다국어

시간 제한메모리 제한제출정답맞힌 사람정답 비율
2 초 512 MB107187382082.329%

문제

Write a program that prints a chessboard with N rows and M columns with the following rules:

  • The top left cell must be an asterisk (*)
  • Any cell touching (left, right, up or down) a cell with an asterisk must be a dot (.)
  • Any cell touching (left, right, up or down) a cell with a dot must be an asterisk.

A chessboard of 8 rows and 8 columns printed using these rules would be:

*.*.*.*.
.*.*.*.*
*.*.*.*.
.*.*.*.*
*.*.*.*.
.*.*.*.*
*.*.*.*.
.*.*.*.*

입력

A single line with two integers N and M separated by spaces. The number N will represent the number of rows and M the number of columns. N and M will be between 1 and 10.

출력

Print N lines each containing M characters with the chessboard pattern.

제한

예제 입력 1

1 1

예제 출력 1

*

예제 입력 2

8 8

예제 출력 2

*.*.*.*.
.*.*.*.*
*.*.*.*.
.*.*.*.*
*.*.*.*.
.*.*.*.*
*.*.*.*.
.*.*.*.*

예제 입력 3

1 5

예제 출력 3

*.*.*

예제 입력 4

6 1

예제 출력 4

*
.
*
.
*
.

예제 입력 5

2 5

예제 출력 5

*.*.*
.*.*.

힌트

출처

Olympiad > All-Ireland Programming Olympiad > 2016 AIPO National Finals 1번

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

출처

대학교 대회

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

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