Submit
 

H : Animal Companion in Maze

Time Limit : 2 sec, Memory Limit : 262144 KB

Problem statement is available from here.