



def    lowerCamelCase_(lowerCamelCase_ = 10**9    ) ->       int:
						UpperCAmelCase         =     1
						UpperCAmelCase         =     2

						UpperCAmelCase         =     0
						UpperCAmelCase         =     0
						UpperCAmelCase         =     0
						while perimeter <= max_perimeter:
												perimeters_sum += perimeter

												prev_value += 2 * value
												value += prev_value

												UpperCAmelCase         =     2 * value + 2 if i % 2 == 0 else 2 * value - 2
												i += 1

						return perimeters_sum


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








import tempfile
import unittest

from transformers import AutoModelForSeqaSeqLM, AutoTokenizer
from transformers.testing_utils import (
    is_torch_available,
    require_optimum,
    require_torch,
    slow,
)


if is_torch_available():
		import torch





@require_torch
@require_optimum
@slow
class  __magic_name__   (							unittest.TestCase						):






		def SCREAMING_SNAKE_CASE_			(						self      :     Tuple      )				->					Optional[int]:
								'''simple docstring'''







								UpperCAmelCase         =     "hf-internal-testing/tiny-random-t5"
								UpperCAmelCase         =     AutoTokenizer.from_pretrained(UpperCamelCase__      )
								UpperCAmelCase         =     AutoModelForSeqaSeqLM.from_pretrained(UpperCamelCase__      )

								UpperCAmelCase         =     tokenizer("This is me"				,		return_tensors="pt"      )

								UpperCAmelCase         =     model.to_bettertransformer()

								self.assertTrue(any("BetterTransformer" in mod.__class__.__name__ for _, mod in model.named_modules()      )      )

								UpperCAmelCase         =     model.generate(**UpperCamelCase__      )

								UpperCAmelCase         =     model.reverse_bettertransformer()

								self.assertFalse(any("BetterTransformer" in mod.__class__.__name__ for _, mod in model.named_modules()      )      )

								with tempfile.TemporaryDirectory() as tmpdirname:
														model.save_pretrained(UpperCamelCase__      )

														UpperCAmelCase         =     AutoModelForSeqaSeqLM.from_pretrained(UpperCamelCase__      )

														self.assertFalse(
														    any("BetterTransformer" in mod.__class__.__name__ for _, mod in model_reloaded.named_modules()      )      )

														UpperCAmelCase         =     model_reloaded.generate(**UpperCamelCase__      )
														self.assertTrue(torch.allclose(UpperCamelCase__				,		UpperCamelCase__      )      )







		def SCREAMING_SNAKE_CASE_			(						self      :     List[str]      )				->					Optional[int]:
								'''simple docstring'''







								UpperCAmelCase         =     "hf-internal-testing/tiny-random-t5"
								UpperCAmelCase         =     AutoModelForSeqaSeqLM.from_pretrained(UpperCamelCase__      )

								UpperCAmelCase         =     model.to_bettertransformer()

								with tempfile.TemporaryDirectory() as tmpdirname:
														with self.assertRaises(UpperCamelCase__      ):
																				model.save_pretrained(UpperCamelCase__      )

														UpperCAmelCase         =     model.reverse_bettertransformer()
														model.save_pretrained(UpperCamelCase__      )



