Rat chases its cheese

bhaiya i tried many times but can’t understand why it is not passing 2 test cases.
give me hint regarding this