



"""simple docstring"""

import math




def __lowercase     (				_a       ):
    snake_case_					:	int							=      math.loga(math.sqrt(4 * positive_integer + 1       ) / 2 + 1 / 2       )

    return exponent == int(lowerCAmelCase__       )




def __lowercase     (				_a = 1 / 12_345       ):
    snake_case_					:	Union[str, Any]							=      0
    snake_case_					:	Optional[int]							=      0

    snake_case_					:	List[str]							=      3
    while True:
        snake_case_					:	Any							=      (integer**2 - 1) / 4
        # if candidate is an integer, then there is a partition for k
        if partition_candidate == int(lowerCAmelCase__       ):
            snake_case_					:	Dict							=      int(lowerCAmelCase__       )
            total_partitions += 1
            if check_partition_perfect(lowerCAmelCase__       ):
                perfect_partitions += 1
        if perfect_partitions > 0:
            if perfect_partitions / total_partitions < max_proportion:
                return int(lowerCAmelCase__       )
        integer += 1


if __name__ == "__main__":
     print(f'{solution() = }')












from typing import TYPE_CHECKING

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


_lowercase		:  Dict			       ={
    """configuration_resnet""": ["""RESNET_PRETRAINED_CONFIG_ARCHIVE_MAP""", """ResNetConfig""", """ResNetOnnxConfig"""]
}

try:
		if not is_torch_available():
				raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
		pass
else:
		_lowercase		:  Union[str, Any]			       =[
		    """RESNET_PRETRAINED_MODEL_ARCHIVE_LIST""",
		    """ResNetForImageClassification""",
		    """ResNetModel""",
		    """ResNetPreTrainedModel""",
		    """ResNetBackbone""",
		]

try:
		if not is_tf_available():
				raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
		pass
else:
		_lowercase		:  Union[str, Any]			       =[
		    """TF_RESNET_PRETRAINED_MODEL_ARCHIVE_LIST""",
		    """TFResNetForImageClassification""",
		    """TFResNetModel""",
		    """TFResNetPreTrainedModel""",
		]

try:
		if not is_flax_available():
				raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
		pass
else:
		_lowercase		:  Tuple			       =[
		    """FlaxResNetForImageClassification""",
		    """FlaxResNetModel""",
		    """FlaxResNetPreTrainedModel""",
		]

if TYPE_CHECKING:
		from .configuration_resnet import RESNET_PRETRAINED_CONFIG_ARCHIVE_MAP, ResNetConfig, ResNetOnnxConfig

		try:
				if not is_torch_available():
						raise OptionalDependencyNotAvailable()
		except OptionalDependencyNotAvailable:
				pass
		else:
				from .modeling_resnet import (
				    RESNET_PRETRAINED_MODEL_ARCHIVE_LIST,
				    ResNetBackbone,
				    ResNetForImageClassification,
				    ResNetModel,
				    ResNetPreTrainedModel,
				)

		try:
				if not is_tf_available():
						raise OptionalDependencyNotAvailable()
		except OptionalDependencyNotAvailable:
				pass
		else:
				from .modeling_tf_resnet import (
				    TF_RESNET_PRETRAINED_MODEL_ARCHIVE_LIST,
				    TFResNetForImageClassification,
				    TFResNetModel,
				    TFResNetPreTrainedModel,
				)

		try:
				if not is_flax_available():
						raise OptionalDependencyNotAvailable()
		except OptionalDependencyNotAvailable:
				pass
		else:
				from .modeling_flax_resnet import FlaxResNetForImageClassification, FlaxResNetModel, FlaxResNetPreTrainedModel


else:
		import sys

		_lowercase		:  Union[str, Any]			       =_LazyModule(__name__, globals()["""__file__"""], _import_structure)
