find pairs given target value