The world's hardest easy ladder problem

Drag the red point "A". When do Points B and C match up?
A ladder length 25m leans against a vertical wall so that it just touches a 5m by 5m by 5m cube that is flush with the wall as shown. How far up the wall does the ladder reach?
Let x be the distance up the wall and y be the distance out from the wall from Pythagoras from similar triangles See question 7 in the 1991 British Mathematical Olympiad for a slightly more general version of the question
See here for the "brute force" approach https://beta.geogebra.org/classic/mwprnjhb

1991 British Mathematical Olympiad (BMO) paper