Solved by 95 users: ...
UserDateAttemptTimeCMSC
ripatti`28 may 2011`C++1200.20671
zmy`21 dec 2007`C++100.03749
mishik`30 sep 2007`C++400.02788
tomek`20 feb 2006`C++101.01790
mishik`30 sep 2007`C++200.02795
LiuChenheng`12 oct 2011`C++100.02824
tnndye`24 may 2007`FPC100.06870
Pupyrev`07 aug 2004`C++1?.??870
RAVEman`30 dec 2008`C++300.23890
mishik`29 sep 2007`C++100.02893
ripatti`28 may 2011`C++1000.20897
FordPerfect`18 feb 2010`C++100.02920
DAV`15 feb 2010`C++1100.08920
 C++ 59 C 16 FPC 11 Kylix 7 Java 3
` >  >  >  >  >  >  >  >  >  > `

Chess end-game

Time limit = 3 seconds

Chess. We have free figures on the board. White: King, Queen. Black: King. White King is on c3 and should not move.

Black King is trying to survive as long as possible. Given White Queen and Black King positions you should find minimal number of moves until checkmate.

Input In the first line the posision of White Queen is given. In the second — the position of Black King. The situation in input is correct, i.e. all figures have different positions and and whites could not kill Black King next move.

 Input#1```f2 c1 ``` Output#1```1 ```
 Input#2```f2 a1 ``` Output#2```1 ```
 Input#3```f4 a1 ``` Output#3```2 ```
 Input#4```h3 a5 ``` Output#4```6 ```

Author:
folklor
6 September 2003

<PREV | Problem set | Search related messages | NEXT>

 © acm.mipt DevGroupThe page was generated in 180ms