Function used to sort all queries so that all queries of the same block are arranged together and within a block , queries are sorted in increasing order of R values .
bool compare ( Query x , Query y ) {