Uva 1047 Zones

acm-icpc
inclusn-exclusn
iterative
uva

#1

Can anyone make a small editorial or explain me the solution of this question?

Link to question: https://uva.onlinejudge.org/external/10/1047.pdf

Thanks in advance.