






"""simple docstring"""



from __future__ import annotations



def 						lowercase   (    __snake_case    :			int		, __snake_case    :			int		, __snake_case    :			int     ):
		assert (
		    c % greatest_common_divisor(__snake_case		, __snake_case     ) == 0
		)  # greatest_common_divisor(a,b) function implemented below
		(lowercase_)			:			Dict								=       extended_gcd(__snake_case		, __snake_case     )  # extended_gcd(a,b) function implemented below
		lowercase_			:			int								=       c / d
		return (r * x, r * y)



def 						lowercase   (    __snake_case    :			int		, __snake_case    :			int		, __snake_case    :			int		, __snake_case    :			int = 2     ):
		(lowercase_)			:			Optional[int]								=       diophantine(__snake_case		, __snake_case		, __snake_case     )  # Initial value
		lowercase_			:			Dict								=       greatest_common_divisor(__snake_case		, __snake_case     )
		lowercase_			:			int								=       a // d
		lowercase_			:			Union[str, Any]								=       b // d

		for i in range(__snake_case     ):
				lowercase_			:			Optional[Any]								=       xa + i * q
				lowercase_			:			Tuple								=       ya - i * p
				print(__snake_case		, __snake_case     )



def 						lowercase   (    __snake_case    :			int		, __snake_case    :			int     ):
		if a < b:
				lowercase_			:			Dict								=       b, a

		while a % b != 0:
				lowercase_			:			Union[str, Any]								=       b, a % b

		return b



def 						lowercase   (    __snake_case    :			int		, __snake_case    :			int     ):
		assert a >= 0 and b >= 0

		if b == 0:
				lowercase_			:			List[Any]								=       a, 1, 0
		else:
				(lowercase_)			:			Optional[Any]								=       extended_gcd(__snake_case		, a % b     )
				lowercase_			:			str								=       q
				lowercase_			:			Optional[int]								=       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)











"""simple docstring"""



from typing import TYPE_CHECKING

from ...utils import OptionalDependencyNotAvailable, _LazyModule, is_tokenizers_available, is_torch_available


__A		:	Any      =		{
    '''configuration_markuplm''': ['''MARKUPLM_PRETRAINED_CONFIG_ARCHIVE_MAP''', '''MarkupLMConfig'''],
    '''feature_extraction_markuplm''': ['''MarkupLMFeatureExtractor'''],
    '''processing_markuplm''': ['''MarkupLMProcessor'''],
    '''tokenization_markuplm''': ['''MarkupLMTokenizer'''],
}

try:
						if not is_tokenizers_available():
												raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
						pass
else:
						__A		:	List[str]      =		['''MarkupLMTokenizerFast''']

try:
						if not is_torch_available():
												raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
						pass
else:
						__A		:	Optional[int]      =		[
						    '''MARKUPLM_PRETRAINED_MODEL_ARCHIVE_LIST''',
						    '''MarkupLMForQuestionAnswering''',
						    '''MarkupLMForSequenceClassification''',
						    '''MarkupLMForTokenClassification''',
						    '''MarkupLMModel''',
						    '''MarkupLMPreTrainedModel''',
						]


if TYPE_CHECKING:
						from .configuration_markuplm import MARKUPLM_PRETRAINED_CONFIG_ARCHIVE_MAP, MarkupLMConfig
						from .feature_extraction_markuplm import MarkupLMFeatureExtractor
						from .processing_markuplm import MarkupLMProcessor
						from .tokenization_markuplm import MarkupLMTokenizer

						try:
												if not is_tokenizers_available():
																		raise OptionalDependencyNotAvailable()
						except OptionalDependencyNotAvailable:
												pass
						else:
												from .tokenization_markuplm_fast import MarkupLMTokenizerFast

						try:
												if not is_torch_available():
																		raise OptionalDependencyNotAvailable()
						except OptionalDependencyNotAvailable:
												pass
						else:
												from .modeling_markuplm import (
												    MARKUPLM_PRETRAINED_MODEL_ARCHIVE_LIST,
												    MarkupLMForQuestionAnswering,
												    MarkupLMForSequenceClassification,
												    MarkupLMForTokenClassification,
												    MarkupLMModel,
												    MarkupLMPreTrainedModel,
												)


else:
						import sys

						__A		:	Optional[Any]      =		_LazyModule(__name__, globals()['''__file__'''], _import_structure)



