gets.to_i.times{puts 'select count(*) from point where (x between %s and %s) and (y between %s and %s);'%gets.split}