#1372
Gold V
Easy Chess
스페셜 저지
시간 제한
2s
메모리 제한
512MB
제출
4
정답
1
맞힌 사람
1
정답 비율
25.0%

문제

Elma is learning chess figures.

She learned that a rook can move either horizontally or vertically. To enhance her understanding of rook movement Elma's grandmother gave Elma an 8×88 \times 8 chess board and asked her to find a way to move the rook from a1 to h8 making exactly nn moves, so that all visited cells are different.

A visited cell is the initial cell a1 and each cell on which the rook lands after a move.

입력

The input contains a single integer nn (2n632 \le n \le 63) — the desired number of moves.

출력

Output a space-separated list of n+1n+1 visited cells in the order they are visited by the rook. All cells must be different. The list should start with a1 and end with h8. A solution always exists.

예제 입력 1

4

예제 출력 1

a1 f1 c1 c8 h8
코드 제출

코드를 제출하려면 로그인이 필요합니다.

로그인
내 제출
제출 내역이 없습니다.
맞은 사람
#순위사용자언어시간메모리코드 길이
8740🥇
백성현
Python8ms8760KB1805B
난이도 투표
Gold V1명 투표· 3일 전
로그인 후 AC 받으면 투표할 수 있습니다.
전체 제출
#사용자문제결과언어시간메모리코드 길이제출 시간
8740
맞았습니다
Python8ms8760KB1805B2026. 06. 03. 07:31
8739
틀렸습니다
Python--1904B2026. 06. 03. 07:22
8738
틀렸습니다
Python--1861B2026. 06. 03. 07:19
8737
틀렸습니다
Python--1889B2026. 06. 03. 07:18