

from __future__ import annotations

import math
from collections.abc import Callable


def     __SCREAMING_SNAKE_CASE   (SCREAMING_SNAKE_CASE__    ,						SCREAMING_SNAKE_CASE__    ,						SCREAMING_SNAKE_CASE__    ,						SCREAMING_SNAKE_CASE__ = 100    ,						):
						snake_case_  =      x_start
						snake_case_  =      fnc(SCREAMING_SNAKE_CASE__			)
						snake_case_  =      0.0

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

												# Increment step
												snake_case_  =      xa
												snake_case_  =      fxa

						return length


if __name__ == "__main__":


					def     __SCREAMING_SNAKE_CASE   (SCREAMING_SNAKE_CASE__			):
											return math.sin(10 * x			)

					print('''f(x) = sin(10 * x)''')
					print('''The length of the curve from x = -10 to x = 10 is:''')
					lowerCAmelCase_			      =      10
					while i <= 10_00_00:
										print(f"""With {i} steps: {line_length(f, -10, 10, i)}""")
										i *= 10






"""simple docstring"""






from __future__ import annotations






def      lowercase__ (					lowerCAmelCase__   :			int							,			lowerCAmelCase__   :			int			)    ->			tuple[int, int]:



			'''simple docstring'''
			if b == 0:
						return (1, 0)
			((a__) ,	(a__))  :	List[Any]		 =			extended_euclid(lowerCAmelCase__							,			a % b			)
			a__  :	str		 =			a // b
			return (y, x - k * y)






def      lowercase__ (					lowerCAmelCase__   :			int							,			lowerCAmelCase__   :			int							,			lowerCAmelCase__   :			int							,			lowerCAmelCase__   :			int			)    ->			int:



			'''simple docstring'''
			((a__) ,	(a__))  :	Tuple		 =			extended_euclid(lowerCAmelCase__							,			lowerCAmelCase__			)
			a__  :	List[str]		 =			na * na
			a__  :	Union[str, Any]		 =			ra * x * na + ra * y * na
			return (n % m + m) % m






def      lowercase__ (					lowerCAmelCase__   :			int							,			lowerCAmelCase__   :			int			)    ->			int:



			'''simple docstring'''
			((a__) ,	(a__))  :	Optional[Any]		 =			extended_euclid(lowerCAmelCase__							,			lowerCAmelCase__			)
			if b < 0:
						a__  :	Optional[int]		 =			(b % n + n) % n
			return b






def      lowercase__ (					lowerCAmelCase__   :			int							,			lowerCAmelCase__   :			int							,			lowerCAmelCase__   :			int							,			lowerCAmelCase__   :			int			)    ->			int:



			'''simple docstring'''
			a__ ,	a__  :	List[Any]		 =			invert_modulo(lowerCAmelCase__							,			lowerCAmelCase__			), invert_modulo(lowerCAmelCase__							,			lowerCAmelCase__			)
			a__  :	Dict		 =			na * na
			a__  :	Any		 =			ra * x * na + ra * y * na
			return (n % m + m) % m


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

		testmod(name='''chinese_remainder_theorem''', verbose=True)
		testmod(name='''chinese_remainder_theorem2''', verbose=True)
		testmod(name='''invert_modulo''', verbose=True)
		testmod(name='''extended_euclid''', verbose=True)