2017 February Contest, Platinum: Problem 1. Why Did the Cow Cross the Road
http://www.usaco.org/current/data/sol_mincross_platinum_feb17.html
I was reading the solution to the problem, and I simply could not understand
“Now, let’s consider what happens when we move one cow from the end of the line to the beginning. Suppose this cow ends up in position P in the second line. Since this cow is the last cow in the first line, we can see it contributes N−P intersections. Moving it to the beginning would then contribute P−1 intersections. So moving it from the first position to last position would change the number of pairs by (P−1)−(N−P).”
How do you move a cow from the end of the first line (basically the first field) to the second line (second field)? Don’t you cycle them independently?