gets;$<.map{|e|puts'select count(*) from point where %s<=x and x<=%s and %s<=y and y<=%s;'%e.split}