




import os
import sys
from contextlib import contextmanager


# Windows only
if os.name == "nt":
      import ctypes
      import msvcrt  # noqa





      class     SCREAMING_SNAKE_CASE__		(ctypes.Structure			):
           # _fields is a specific attr expected by ctypes
           lowercase_ :      List[Any]				= [("size", ctypes.c_int), ("visible", ctypes.c_byte)]
def 		a_							( ):
  if os.name == "nt":
    lowerCAmelCase__										=      CursorInfo()
    lowerCAmelCase__										=      ctypes.windll.kernelaa.GetStdHandle(-11				)
    ctypes.windll.kernelaa.GetConsoleCursorInfo(__lowerCAmelCase   , ctypes.byref(__lowerCAmelCase				)				)
    lowerCAmelCase__										=      False
    ctypes.windll.kernelaa.SetConsoleCursorInfo(__lowerCAmelCase   , ctypes.byref(__lowerCAmelCase				)				)
  elif os.name == "posix":
    sys.stdout.write('''\033[?25l'''				)
    sys.stdout.flush()
def 		a_							( ):
  if os.name == "nt":
    lowerCAmelCase__										=      CursorInfo()
    lowerCAmelCase__										=      ctypes.windll.kernelaa.GetStdHandle(-11				)
    ctypes.windll.kernelaa.GetConsoleCursorInfo(__lowerCAmelCase   , ctypes.byref(__lowerCAmelCase				)				)
    lowerCAmelCase__										=      True
    ctypes.windll.kernelaa.SetConsoleCursorInfo(__lowerCAmelCase   , ctypes.byref(__lowerCAmelCase				)				)
  elif os.name == "posix":
    sys.stdout.write('''\033[?25h'''				)
    sys.stdout.flush()




@contextmanager
def 		a_							( ):
  try:
    hide_cursor()
    yield
  finally:
    show_cursor()







from __future__ import annotations
def 		a_							( __lowerCAmelCase				):
  if not nums:
    return 0
  lowerCAmelCase__										=      nums[0]
  lowerCAmelCase__										=      0
  for num in nums[1:]:
    lowerCAmelCase__				,      lowerCAmelCase__										=      (
        max_excluding + num,
        max(__lowerCAmelCase   , __lowerCAmelCase				),
    )
  return max(__lowerCAmelCase   , __lowerCAmelCase				)


if __name__ == "__main__":
      import doctest

      doctest.testmod()

