from __future__ import annotations







def 						UpperCAmelCase							(		lowerCAmelCase_    ,   lowerCAmelCase_    ,   lowerCAmelCase_							)						->						tuple[float, float]:
     assert (
         c % greatest_common_divisor(lowerCAmelCase_    ,   lowerCAmelCase_							) == 0
     )  # greatest_common_divisor(a,b) function implemented below
     ((a)      ,				(a)      ,				(a))	:     Optional[int]						      =    extended_gcd(lowerCAmelCase_    ,   lowerCAmelCase_							)  # extended_gcd(a,b) function implemented below
     a	:     int						      =    c / d
     return (r * x, r * y)







def 						UpperCAmelCase							(		lowerCAmelCase_    ,   lowerCAmelCase_    ,   lowerCAmelCase_    ,   lowerCAmelCase_ = 2							)						->						None:
     ((a)      ,				(a))	:     List[str]						      =    diophantine(lowerCAmelCase_    ,   lowerCAmelCase_    ,   lowerCAmelCase_							)  # Initial value
     a	:     List[Any]						      =    greatest_common_divisor(lowerCAmelCase_    ,   lowerCAmelCase_							)
     a	:     Optional[Any]						      =    a // d
     a	:     str						      =    b // d

     for i in range(lowerCAmelCase_							):
          a	:     Tuple						      =    xa + i * q
          a	:     Union[str, Any]						      =    ya - i * p
          print(lowerCAmelCase_    ,   lowerCAmelCase_							)







def 						UpperCAmelCase							(		lowerCAmelCase_    ,   lowerCAmelCase_							)						->						int:
     if a < b:
          a      ,				a	:     List[str]						      =    b, a

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

     return b







def 						UpperCAmelCase							(		lowerCAmelCase_    ,   lowerCAmelCase_							)						->						tuple[int, int, int]:
     assert a >= 0 and b >= 0

     if b == 0:
          a      ,				a      ,				a	:     Optional[int]						      =    a, 1, 0
     else:
          ((a)      ,				(a)      ,				(a))	:     Tuple						      =    extended_gcd(lowerCAmelCase_    ,   a % b							)
          a	:     Union[str, Any]						      =    q
          a	:     Union[str, Any]						      =    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)
from typing import TYPE_CHECKING

from ...utils import (
    OptionalDependencyNotAvailable,
    _LazyModule,
    is_flax_available,
    is_sentencepiece_available,
    is_tf_available,
    is_tokenizers_available,
    is_torch_available,
)


UpperCAmelCase				 =   {"""configuration_pegasus""": ["""PEGASUS_PRETRAINED_CONFIG_ARCHIVE_MAP""", """PegasusConfig"""]}

try:
  if not is_sentencepiece_available():
    raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
  pass
else:
  UpperCAmelCase				 =   ["""PegasusTokenizer"""]

try:
  if not is_tokenizers_available():
    raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
  pass
else:
  UpperCAmelCase				 =   ["""PegasusTokenizerFast"""]

try:
  if not is_torch_available():
    raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
  pass
else:
  UpperCAmelCase				 =   [
      """PEGASUS_PRETRAINED_MODEL_ARCHIVE_LIST""",
      """PegasusForCausalLM""",
      """PegasusForConditionalGeneration""",
      """PegasusModel""",
      """PegasusPreTrainedModel""",
  ]

try:
  if not is_tf_available():
    raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
  pass
else:
  UpperCAmelCase				 =   [
      """TFPegasusForConditionalGeneration""",
      """TFPegasusModel""",
      """TFPegasusPreTrainedModel""",
  ]

try:
  if not is_flax_available():
    raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
  pass
else:
  UpperCAmelCase				 =   [
      """FlaxPegasusForConditionalGeneration""",
      """FlaxPegasusModel""",
      """FlaxPegasusPreTrainedModel""",
  ]


if TYPE_CHECKING:
  from .configuration_pegasus import PEGASUS_PRETRAINED_CONFIG_ARCHIVE_MAP, PegasusConfig

  try:
    if not is_sentencepiece_available():
      raise OptionalDependencyNotAvailable()
  except OptionalDependencyNotAvailable:
    pass
  else:
    from .tokenization_pegasus import PegasusTokenizer

  try:
    if not is_tokenizers_available():
      raise OptionalDependencyNotAvailable()
  except OptionalDependencyNotAvailable:
    pass
  else:
    from .tokenization_pegasus_fast import PegasusTokenizerFast

  try:
    if not is_torch_available():
      raise OptionalDependencyNotAvailable()
  except OptionalDependencyNotAvailable:
    pass
  else:
    from .modeling_pegasus import (
        PEGASUS_PRETRAINED_MODEL_ARCHIVE_LIST,
        PegasusForCausalLM,
        PegasusForConditionalGeneration,
        PegasusModel,
        PegasusPreTrainedModel,
    )

  try:
    if not is_tf_available():
      raise OptionalDependencyNotAvailable()
  except OptionalDependencyNotAvailable:
    pass
  else:
    from .modeling_tf_pegasus import TFPegasusForConditionalGeneration, TFPegasusModel, TFPegasusPreTrainedModel

  try:
    if not is_flax_available():
      raise OptionalDependencyNotAvailable()
  except OptionalDependencyNotAvailable:
    pass
  else:
    from .modeling_flax_pegasus import (
        FlaxPegasusForConditionalGeneration,
        FlaxPegasusModel,
        FlaxPegasusPreTrainedModel,
    )

else:
  import sys

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