


'''simple docstring'''



from collections.abc import Sequence




def      _a     (						_lowercase :     Sequence[float]      , _lowercase :     bool = False  ):





     '''simple docstring'''






     if not arr:
          return 0

     __UpperCAmelCase     :			Tuple  							=      0 if allow_empty_subarrays else float('''-inf'''  )
     __UpperCAmelCase     :			List[Any]  							=      0.0
     for num in arr:
          __UpperCAmelCase     :			List[Any]  							=      max(0 if allow_empty_subarrays else num      , curr_sum + num  )
          __UpperCAmelCase     :			Optional[Any]  							=      max(_lowercase      , _lowercase  )

     return max_sum


if __name__ == "__main__":
    from doctest import testmod

    testmod()

    __UpperCAmelCase      :Union[str, Any]			    =       [-2, 1, -3, 4, -1, 2, 1, -5, 4]
    print(f"""{max_subarray_sum(nums) = }""")



'''simple docstring'''



def      _a     (						_lowercase :     int = 600851475143  ):





     '''simple docstring'''






     try:
          __UpperCAmelCase     :			str  							=      int(_lowercase  )
     except (TypeError, ValueError):
          raise TypeError('''Parameter n must be int or castable to int.'''  )
     if n <= 0:
          raise ValueError('''Parameter n must be greater than or equal to one.'''  )
     __UpperCAmelCase     :			Dict  							=      1
     __UpperCAmelCase     :			List[str]  							=      2
     while i * i <= n:
          while n % i == 0:
               __UpperCAmelCase     :			int  							=      i
               n //= i
          i += 1
     if n > 1:
          __UpperCAmelCase     :			List[str]  							=      n
     return int(_lowercase  )


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