Regarding question MAXEP of december long challenge

december
long-contest

#1

Plz explain first sub task
https://www.codechef.com/DEC18B/problems/MAXEP

alt text


#2

The first sub-task just reduces the constraint on N from 1 to 1000 from 1 to 150000. All other constraints remain the same.