You cannot make jumps more than L in any direction(L is the maximum distance). We are given a query array which gives the starting and ending element of the positions.