A Leapfrog in the Array

CodeForces - 949B