





from __future__ import annotations







def  A					(				UpperCAmelCase	,	UpperCAmelCase	,	UpperCAmelCase					):
					assert (
					    c % greatest_common_divisor(UpperCAmelCase	,	UpperCAmelCase					) == 0
					)  # greatest_common_divisor(a,b) function implemented below
					((_snake_case)							,			(_snake_case)							,			(_snake_case))							:       Dict												= extended_gcd(UpperCAmelCase	,	UpperCAmelCase					)  # extended_gcd(a,b) function implemented below
					_snake_case							:       Tuple												= c / d
					return (r * x, r * y)







def  A					(				UpperCAmelCase	,	UpperCAmelCase	,	UpperCAmelCase	,	UpperCAmelCase = 2					):
					((_snake_case)							,			(_snake_case))							:       str												= diophantine(UpperCAmelCase	,	UpperCAmelCase	,	UpperCAmelCase					)  # Initial value
					_snake_case							:       Optional[Any]												= greatest_common_divisor(UpperCAmelCase	,	UpperCAmelCase					)
					_snake_case							:       Union[str, Any]												= a // d
					_snake_case							:       Union[str, Any]												= b // d

					for i in range(UpperCAmelCase					):
										_snake_case							:       str												= xa + i * q
										_snake_case							:       List[Any]												= ya - i * p
										print(UpperCAmelCase	,	UpperCAmelCase					)







def  A					(				UpperCAmelCase	,	UpperCAmelCase					):
					if a < b:
										_snake_case							,			_snake_case							:       Tuple												= b, a

					while a % b != 0:
										_snake_case							,			_snake_case							:       Any												= b, a % b

					return b







def  A					(				UpperCAmelCase	,	UpperCAmelCase					):
					assert a >= 0 and b >= 0

					if b == 0:
										_snake_case							,			_snake_case							,			_snake_case							:       Any												= a, 1, 0
					else:
										((_snake_case)							,			(_snake_case)							,			(_snake_case))							:       Optional[Any]												= extended_gcd(UpperCAmelCase	,	a % b					)
										_snake_case							:       Optional[Any]												= q
										_snake_case							:       str												= p - q * (a // b)

					assert a % d == 0 and b % d == 0
					assert d == a * x + b * y

					return (d, x, y)


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

							testmod(name='diophantine', verbose=True)
							testmod(name='diophantine_all_soln', verbose=True)
							testmod(name='extended_gcd', verbose=True)
							testmod(name='greatest_common_divisor', verbose=True)






def  A					(				UpperCAmelCase	,	UpperCAmelCase					):
					# "Simpson Rule"
					# int(f) = delta_x/2 * (b-a)/3*(f1 + 4f2 + 2f_3 + ... + fn)
					_snake_case							:       List[str]												= (boundary[1] - boundary[0]) / steps
					_snake_case							:       List[Any]												= boundary[0]
					_snake_case							:       Tuple												= boundary[1]
					_snake_case							:       str												= make_points(UpperCAmelCase	,	UpperCAmelCase	,	UpperCAmelCase					)
					_snake_case							:       str												= 0.0
					y += (h / 3.0) * f(UpperCAmelCase					)
					_snake_case							:       Tuple												= 2
					for i in x_i:
										y += (h / 3) * (4 - 2 * (cnt % 2)) * f(UpperCAmelCase					)
										cnt += 1
					y += (h / 3.0) * f(UpperCAmelCase					)
					return y







def  A					(				UpperCAmelCase	,	UpperCAmelCase	,	UpperCAmelCase					):
					_snake_case							:       Union[str, Any]												= a + h
					while x < (b - h):
										yield x
										_snake_case							:       Optional[Any]												= x + h







def  A					(				UpperCAmelCase					):  # enter your function here
					_snake_case							:       Dict												= (x - 0) * (x - 0)
					return y







def  A					(				):
					_snake_case							:       int												= 0.0  # Lower bound of integration
					_snake_case							:       Union[str, Any]												= 1.0  # Upper bound of integration
					_snake_case							:       List[str]												= 1_0.0  # define number of steps or resolution
					_snake_case							:       Optional[int]												= [a, b]  # define boundary of integration
					_snake_case							:       List[str]												= method_a(UpperCAmelCase	,	UpperCAmelCase					)
					print(F"""y = {y}"""					)


if __name__ == "__main__":
							main()