


"""simple docstring"""






def 			A__		(					_UpperCAmelCase    :      list				,    _UpperCAmelCase    :      int				,    _UpperCAmelCase    :      int				,    _UpperCAmelCase    :      int	)							->	int:

	'''simple docstring'''


	snake_case__  :						Optional[int]		=      int((lower_bound + upper_bound) // 2	)
	if array[r] == value:
		return r
	if lower_bound >= upper_bound:
		return -1
	if array[r] < value:
		return binary_search(_UpperCAmelCase				,    r + 1				,    _UpperCAmelCase				,    _UpperCAmelCase	)
	else:
		return binary_search(_UpperCAmelCase				,    _UpperCAmelCase				,    r - 1				,    _UpperCAmelCase	)



def 			A__		(					_UpperCAmelCase    :      int				,    _UpperCAmelCase    :      list	)							->	list:

	'''simple docstring'''


	snake_case__  :						List[Any]		=      0
	if matrix[index][0] == value:
		return [index, 0]
	while index < len(_UpperCAmelCase	) and matrix[index][0] < value:
		snake_case__  :						Tuple		=      binary_search(matrix[index]				,    0				,    len(matrix[index]	) - 1				,    _UpperCAmelCase	)
		if r != -1:
			return [index, r]
		index += 1
	return [-1, -1]


if __name__ == "__main__":
					import doctest

					doctest.testmod()










"""simple docstring"""







def 							UpperCamelCase_       (       lowerCAmelCase__ :							int = 400_0000		)		->  int:

  """simple docstring"""




  if n <= 1:
    return 0
  lowerCAmelCase_  :							Union[str, Any]								=					0
  lowerCAmelCase_  :							Tuple								=					2
  lowerCAmelCase_  :							List[Any]								=					0
  while 4 * b + a <= n:
    lowerCAmelCase_		,lowerCAmelCase_  :							str								=					b, 4 * b + a
    count += a
  return count + b


if __name__ == "__main__":
     print(f'{solution() = }')





