Solution of the rod problem

 

v20240901