Use two separate loops because of different increments to solve this
problem.