Let’s forget the equation and think about what we want to do here.
We have boxes that we want to move from one place to another. The other place is bigger and the boss wants to stack it exactly like this.
If we move one box at a time, we want to know what is the distance of moving the box. Here, we care about the horizontal distance only. There are many ways to move the boxes. So the equation is finding a particular way that the total distance of moving the boxes is the lowest. Technically, it means the greatest lower bound.