gets.to_i.times do x1, x2, y1, y2 = gets.split(" ") puts "SELECT count(*) FROM point WHERE #{x1} <= x <= #{x2} AND #{y1} <= y <= #{y2};" end