Masala #S3REFN0YLW

Xotira 16 MB Vaqt 1000 ms
14

Eng kuchli shoh

8×8 shaxmat doskasida “Eng kuchli shoh” figurasi a​ katakda turibdi. “Eng kuchli shoh” figurasi kuchli shoh(https://robocontest.uz/tasks/0913)dan farqi shundaki, uning bir yurishi 2 barobar kattaroqdir. U b katakka minimal necha yurishda bora oladi?


Kiruvchi ma'lumotlar:

Yagona qatorda ikkita satr a va b​, 8×8 doskadagi kataklar beriladi.


Chiquvchi ma'lumotlar:

Bitta butun son — “Eng kuchli shoh”a​ katakdan b katakka borishi uchun kerak bo‘ladigan minimal yurishlar sonini chiqaring.


Misollar
# input.txt output.txt
1
a6 a8
1
2
a1 h5
2
Izoh:

Etibor bering “Eng kuchli shoh” figurasi kuchli shohdan farqi shundaki, uning bir yurishi 2 barobar kattaroqdir.Kushli shohni siz 913-masalada qanday yurishini bilib olgansiz.