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

34381번 - Knights Move 다국어

시간 제한메모리 제한제출정답맞힌 사람정답 비율
1 초 2048 MB55493589.744%

문제

Before we get into the problem, let's go over algebraic notation in chess. Algebraic notation refers to the "names" of the squares on a chessboard. Starting from left to right (from white's perspective), the columns are named a--h. The rows are then named 1ドル$--8ドル$ in increasing order (again from white's perspective). Each square's "name" is the column letter followed by the row number of that particular square.

In chess, a knight's move is unique. It may move two squares horizontally and one square vertically, or two squares vertically and one square horizontally (with both forming the shape of an L). For example, a knight on d3 can move to c1, b2, b4, c5, e5, f4, f2, and e1.

Your task is as follows: given the position of a knight on a chessboard in algebraic notation, output all of the knight's possible moves.

입력

The first (and only) line of input is the location of the knight in algebraic notation. It is guaranteed that it will be a valid square on an 8ドル \times 8$ chessboard.

출력

Output all of the knight's possible moves in lexicographic order, with each square on its own line. Lexicographic order is a generalization of alphabetical order that means c1 comes before d1, a1 comes before a2, etc.

제한

예제 입력 1

a1

예제 출력 1

b3
c2

예제 입력 2

d3

예제 출력 2

b2
b4
c1
c5
e1
e5
f2
f4

노트

출처

School > CS@Mines > CS@Mines HSPC 2022 > Beginner B번

  • 문제를 만든 사람: John Henke
(追記) (追記ここまで)

출처

대학교 대회

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

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