Codeforces Football Session

I did not understand the explanation which was given to prove that the value of y calculated after taking mod is minimum possible. Please explain.

@LP18Aug0068
Please see the solution here https://codeforces.com/blog/entry/70553
I hope you do understand that giving an explanation of something in the video here in detail is impractical for me and also not possible for me. If you feel the video wasn’t descriptive enough maybe you can message the mentor on the group informing him of the problem.