





'''simple docstring'''




from __future__ import annotations

import math
from collections.abc import Callable







def _lowerCAmelCase     (      _lowerCAmelCase       ,    _lowerCAmelCase       ,    _lowerCAmelCase       ,    _lowerCAmelCase = 1_00       ,    )->     float:
 __UpperCAmelCase					=   x_start
 __UpperCAmelCase					=   fnc(_lowerCAmelCase    )
 __UpperCAmelCase					=   0.0

 for _ in range(_lowerCAmelCase    ):
  # Approximates curve as a sequence of linear lines and sums their length
  __UpperCAmelCase					=   (x_end - x_start) / steps + xa
  __UpperCAmelCase					=   fnc(_lowerCAmelCase    )
  length += math.hypot(xa - xa       ,    fxa - fxa    )

  # Increment step
  __UpperCAmelCase					=   xa
  __UpperCAmelCase					=   fxa

 return length


if __name__ == "__main__":







    def _lowerCAmelCase     (      _lowerCAmelCase    )->     Any:
     return math.sin(10 * x    )

    print("""f(x) = sin(10 * x)""")
    print("""The length of the curve from x = -10 to x = 10 is:""")
    _A:					Optional[int]							=				10
    while i <= 100_000:
        print(F"""With {i} steps: {line_length(f, -10, 10, i)}""")
        i *= 10












'''simple docstring'''




from __future__ import annotations







def _lowerCAmelCase     (      _lowerCAmelCase    )->     int:
 if not nums:
  return 0
 __UpperCAmelCase					=   nums[0]
 __UpperCAmelCase					=   0
 for num in nums[1:]:
  __UpperCAmelCase					,    __UpperCAmelCase					=   (
      max_excluding + num,
      max(_lowerCAmelCase       ,    _lowerCAmelCase    ),
  )
 return max(_lowerCAmelCase       ,    _lowerCAmelCase    )


if __name__ == "__main__":
    import doctest

    doctest.testmod()





