





from __future__ import annotations

def   a_   (			lowerCAmelCase_				:      list[int | float],     lowerCAmelCase_				:      int,     lowerCAmelCase_				:      int     ):
   if len(lowerCAmelCase_     ) == 0:
      raise ValueError('find_max() arg is an empty sequence'     )
   if (
       left >= len(lowerCAmelCase_     )
       or left < -len(lowerCAmelCase_     )
       or right >= len(lowerCAmelCase_     )
       or right < -len(lowerCAmelCase_     )
   ):
      raise IndexError('list index out of range'     )
   if left == right:
      return nums[left]
   __lowerCAmelCase							     =     (left + right) >> 1  # the middle
   __lowerCAmelCase							     =     find_max(lowerCAmelCase_,     lowerCAmelCase_,     lowerCAmelCase_     )  # find max in range[left, mid]
   __lowerCAmelCase							     =     find_max(lowerCAmelCase_,     mid + 1,     lowerCAmelCase_     )  # find max in range[mid + 1, right]

   return left_max if left_max >= right_max else right_max


if __name__ == "__main__":
     import doctest

     doctest.testmod(verbose=True)








from functools import lru_cache

@lru_cache
def   a_   (			lowerCAmelCase_				:      int     ):
   if num < 0:
      raise ValueError('Number should not be negative.'     )

   return 1 if num in (0, 1) else num * factorial(num - 1     )


if __name__ == "__main__":
     import doctest

     doctest.testmod()

