


"""simple docstring"""


from __future__ import annotations







def  __snake_case       (   UpperCamelCase__ ,			UpperCamelCase__ ,			UpperCamelCase__ ,			UpperCamelCase__	)      ->		Optional[Any]:  # noqa: E741







		"""simple docstring"""





		while r - l > 1:
				A					       = (l + r) // 2
				if v[m] >= key:
						A					       = m
				else:
						A					       = m  # noqa: E741
		return r







def  __snake_case       (   UpperCamelCase__	)      ->		int:







		"""simple docstring"""





		if len(UpperCamelCase__	) == 0:
				return 0

		A					       = [0] * len(UpperCamelCase__	)
		A					       = 1

		A					       = v[0]

		for i in range(1 ,			len(UpperCamelCase__	)	):
				if v[i] < tail[0]:
						A					       = v[i]
				elif v[i] > tail[length - 1]:
						A					       = v[i]
						length += 1
				else:
						A					       = v[i]

		return length


if __name__ == "__main__":
	import doctest

	doctest.testmod()









"""simple docstring"""


from __future__ import annotations







def  __snake_case       (   UpperCamelCase__	)      ->		int:







		"""simple docstring"""





		if not nums:
				return 0
		A					       = nums[0]
		A					       = 0
		for num in nums[1:]:
				A       , A					       = (
				    max_excluding + num,
				    max(UpperCamelCase__ ,			UpperCamelCase__	),
				)
		return max(UpperCamelCase__ ,			UpperCamelCase__	)


if __name__ == "__main__":
	import doctest

	doctest.testmod()





