Optimal Walk

IIKI is in great trouble. In the game called BIIKI, The Hero CIIKI gets power $M$ for per kilometer distance covered in the X-direction and power $N$ for per kilometer distance covered in the Y-direction. Initially, CIIKI is in (0,0) coordinate and can go any direction but not in any negative direction.


This is a companion discussion topic for the original entry at https://toph.co/p/optimal-walk