Reorder the Array

CodeForces - 1007A