Anjali and her fat cat


For the problem in cypher october there was a problem here. It asks to find the shortest path in the plane to move from one point to other.

According to the solution the distance was just added commenting dist = int(math.sqrt(m**2 + n**2)). Can someone explain why? because i did the same thing