There are nn students standing in line in positions 11 to nn. While the teacher looks away, some students change their positions. When the teacher looks back, they are standing in line again. If a student who was initially in position ii is now in position jj, we say the student moved for ij|i - j| steps. Determine the maximal sum of steps of all students that they can achieve.