
"""simple docstring"""






def       A_  (				__lowercase = 3						,	__lowercase = 7						,	__lowercase = 1_00_00_00	):
 UpperCamelCase_     :					Dict   	=0
 UpperCamelCase_     :					Optional[Any]   	=1

 for current_denominator in range(1						,	limit + 1	):
  UpperCamelCase_     :					Optional[Any]   	=current_denominator * numerator // denominator
  if current_denominator % denominator == 0:
   current_numerator -= 1
  if current_numerator * max_denominator > current_denominator * max_numerator:
   UpperCamelCase_     :					Optional[Any]   	=current_numerator
   UpperCamelCase_     :					int   	=current_denominator
 return max_numerator


if __name__ == "__main__":
 print(solution(numerator=3, denominator=7, limit=1_000_000))


"""simple docstring"""






from typing import TYPE_CHECKING

from ...utils import (
    OptionalDependencyNotAvailable,
    _LazyModule,
    is_torch_available,
)


__SCREAMING_SNAKE_CASE							=     {
    'configuration_mega': ['MEGA_PRETRAINED_CONFIG_ARCHIVE_MAP', 'MegaConfig', 'MegaOnnxConfig'],
}

try:
 if not is_torch_available():
  raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
 pass
else:
 __SCREAMING_SNAKE_CASE							=     [
     'MEGA_PRETRAINED_MODEL_ARCHIVE_LIST',
     'MegaForCausalLM',
     'MegaForMaskedLM',
     'MegaForMultipleChoice',
     'MegaForQuestionAnswering',
     'MegaForSequenceClassification',
     'MegaForTokenClassification',
     'MegaModel',
     'MegaPreTrainedModel',
 ]

if TYPE_CHECKING:
 from .configuration_mega import MEGA_PRETRAINED_CONFIG_ARCHIVE_MAP, MegaConfig, MegaOnnxConfig

 try:
  if not is_torch_available():
   raise OptionalDependencyNotAvailable()
 except OptionalDependencyNotAvailable:
  pass
 else:
  from .modeling_mega import (
      MEGA_PRETRAINED_MODEL_ARCHIVE_LIST,
      MegaForCausalLM,
      MegaForMaskedLM,
      MegaForMultipleChoice,
      MegaForQuestionAnswering,
      MegaForSequenceClassification,
      MegaForTokenClassification,
      MegaModel,
      MegaPreTrainedModel,
  )

else:
 import sys

 __SCREAMING_SNAKE_CASE							=     _LazyModule(__name__, globals()['__file__'], _import_structure, module_spec=__spec__)
