Please subscribe to the official Codeforces channel in Telegram via the link https://t.me/codeforces_official. ×

Help needed for proof regarding a well known fact in CP

Revision en1, by Romok007, 2021-12-10 23:52:13

Hello everyone, I came across this beautiful problem Problem. However in order to solve this problem it assumes that the shortest distance between a king at point (x, y) and any arbitrary point (x', y') is given as max(|x' — x|, |y' — y|).

The above distance is Chebyshev Distance and it is true for Kings on a chessboard. Can someone help me with the proof or at least an intuition why the above formula is true. Thanks in advance :).

Tags #algorithm

History

 
 
 
 
Revisions
 
 
  Rev. Lang. By When Δ Comment
en1 English Romok007 2021-12-10 23:52:13 592 Initial revision (published)