Range of queries and their solutions