#P9795. [NERC 2018] Easy Chess

    ID: 10629 远端评测题 1000ms 128MiB 尝试: 0 已通过: 0 显示难度普及+/提高− 上传者: 标签>2018Special JudgeICPC

[NERC 2018] Easy Chess

Background

Translated from Problem E of NERC 2018.

Problem Description

Elma is learning chess.

Elma is a beginner, and she does not really understand how to play chess yet. To help her understand chess better, her grandmother asks her to make nn moves on a board (as shown below). In each move, she can move horizontally or vertically by any number of squares, and each square can be visited at most once, so that she goes from a1 to h8.

Input Format

Input one integer n(2n63)n(2 \leq n \leq 63), which means the total number of moves you need to make.

Output Format

Output one feasible solution, and make sure that the squares you have stayed on are not repeated.

4
a1 f1 c1 c8 h8

Hint

For all testdata, it is guaranteed that 2n632 \leq n \leq 63, and that there exists at least one legal solution.

Translated by ChatGPT 5