Here is the solution for Codeforces 1325D which is mostly a math problem.
Here is the problem statement: https://codeforces.com/problemset/problem/1325/D
Here is my solution (the code presented in the video):
https://codeforces.com/contest/1325/submission/73294496
For more help with USACO contests, visit https://www.vplanetcoding.com/?sl=yt1325D_jul252020