search a sorted matrix