Editorial for Mock CCC '19 Contest 2 S2 - Tudor Puts A Goat On A Rope
Submitting an official solution before solving the problem yourself is a bannable offence.
Imagine shifting the rectangle either horizontally or vertically, but not both simultaneously. If the point can touch the rectangle after some shift, then the distance can be computed explicitly.
Otherwise, the point is closest to a corner, and all of them can be checked for the minimal distance.