Problem from the Olympiad in sports programming

 

v20240901