The problem scenario is defined as follows problem statement (Click here)
The information what happens in one single iteration is provided here in this link
I