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

21875번 - Innohorse 다국어

시간 제한메모리 제한제출정답맞힌 사람정답 비율
1 초 512 MB56645342580.645%

문제

In Innokingdom there are special horses for chess knights, innohorses. Each innohorse is represented by a pair of integers $(x, y),ドル 0ドル \le x \le y$. Innohorse moves in the following way: first it moves $x$ cells in one of the four general directions, then turns 90 degrees to the left or to the right, then finally moves $y$ more cells. For instance, an ordinary chess knight horse is an innohorse of type $(1, 2)$.

Alex and Jane has just seen one innohorse, it jumped from cell A to cell B. They wonder what is the type of this innohorse. Help them answer this question.

입력

Chessboard consists of 8 rows and 8 columns. Rows are assigned integers from 1 to 8, and columns are assigned letters from 'a' to 'h'. So every cell is represented by a pair of a letter and a digit.

Two lines consist of descriptions of cells A and B respectively.

출력

Print two integers $x$ and $y$ (0ドル \le x \le y$), representing the type of innohorse.

제한

예제 입력 1

a1
b3

예제 출력 1

1 2

예제 입력 2

g5
d3

예제 출력 2

2 3

힌트

출처

Contest > Innopolis Open in Informatics > Innopolis Open, First elimination round, 2018-2019 A번

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

출처

대학교 대회

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

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