
"""simple docstring"""







from __future__ import annotations




def 			A_			(					lowercase						, lowercase						, lowercase      )     ->							tuple[float, float]:


     """simple docstring"""







     assert (
         c % greatest_common_divisor(SCREAMING_SNAKE_CASE__						, SCREAMING_SNAKE_CASE__      ) == 0
     )  # greatest_common_divisor(a,b) function implemented below
     (UpperCAmelCase_)						:    Tuple    					=  extended_gcd(SCREAMING_SNAKE_CASE__						, SCREAMING_SNAKE_CASE__      )  # extended_gcd(a,b) function implemented below
     UpperCAmelCase_						:    Tuple    					=  c / d
     return (r * x, r * y)




def 			A_			(					lowercase						, lowercase						, lowercase						, lowercase = 2      )     ->							None:


     """simple docstring"""







     (UpperCAmelCase_)						:    List[Any]    					=  diophantine(SCREAMING_SNAKE_CASE__						, SCREAMING_SNAKE_CASE__						, SCREAMING_SNAKE_CASE__      )  # Initial value
     UpperCAmelCase_						:    int    					=  greatest_common_divisor(SCREAMING_SNAKE_CASE__						, SCREAMING_SNAKE_CASE__      )
     UpperCAmelCase_						:    Optional[int]    					=  a // d
     UpperCAmelCase_						:    Optional[Any]    					=  b // d

     for i in range(SCREAMING_SNAKE_CASE__      ):
          UpperCAmelCase_						:    int    					=  xa + i * q
          UpperCAmelCase_						:    int    					=  ya - i * p
          print(SCREAMING_SNAKE_CASE__						, SCREAMING_SNAKE_CASE__      )




def 			A_			(					lowercase						, lowercase      )     ->							int:


     """simple docstring"""







     if a < b:
          UpperCAmelCase_						:    Dict    					=  b, a

     while a % b != 0:
          UpperCAmelCase_						:    Optional[Any]    					=  b, a % b

     return b




def 			A_			(					lowercase						, lowercase      )     ->							tuple[int, int, int]:


     """simple docstring"""







     assert a >= 0 and b >= 0

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



"""simple docstring"""







from typing import TYPE_CHECKING

from ...utils import OptionalDependencyNotAvailable, _LazyModule, is_torch_available


lowercase_						    =					{"configuration_visual_bert": ["VISUAL_BERT_PRETRAINED_CONFIG_ARCHIVE_MAP", "VisualBertConfig"]}

try:
       if not is_torch_available():
              raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
       pass
else:
       lowercase_						    =					[
           "VISUAL_BERT_PRETRAINED_MODEL_ARCHIVE_LIST",
           "VisualBertForMultipleChoice",
           "VisualBertForPreTraining",
           "VisualBertForQuestionAnswering",
           "VisualBertForRegionToPhraseAlignment",
           "VisualBertForVisualReasoning",
           "VisualBertLayer",
           "VisualBertModel",
           "VisualBertPreTrainedModel",
       ]


if TYPE_CHECKING:
       from .configuration_visual_bert import VISUAL_BERT_PRETRAINED_CONFIG_ARCHIVE_MAP, VisualBertConfig

       try:
              if not is_torch_available():
                     raise OptionalDependencyNotAvailable()
       except OptionalDependencyNotAvailable:
              pass
       else:
              from .modeling_visual_bert import (
                  VISUAL_BERT_PRETRAINED_MODEL_ARCHIVE_LIST,
                  VisualBertForMultipleChoice,
                  VisualBertForPreTraining,
                  VisualBertForQuestionAnswering,
                  VisualBertForRegionToPhraseAlignment,
                  VisualBertForVisualReasoning,
                  VisualBertLayer,
                  VisualBertModel,
                  VisualBertPreTrainedModel,
              )


else:
       import sys

       lowercase_						    =					_LazyModule(__name__, globals()["__file__"], _import_structure, module_spec=__spec__)

