import pickle
import unittest

import torch

from accelerate import Accelerator
from accelerate.state import AcceleratorState
from accelerate.test_utils import require_cpu
@require_cpu
class     lowerCAmelCase_     (       unittest.TestCase ):







							def  UpperCamelCase_						(   self      :     str		):
												_UpperCamelCase			     =     torch.nn.Linear(10 ,			10		)
												_UpperCamelCase			     =     torch.optim.SGD(model.parameters() ,			0.1		)
												_UpperCamelCase			     =     Accelerator()
												_UpperCamelCase			     =     accelerator.prepare(_A		)
												try:
																	pickle.loads(pickle.dumps(_A		)		)
												except Exception as e:
																	self.fail(F"""Accelerated optimizer pickling failed with {e}"""		)
												AcceleratorState._reset_state()








"""simple docstring"""


from math import sqrt


def        UpperCAmelCase      (					a__ = 1_00_00_00 ):





						'''simple docstring'''






						lowerCAmelCase   :int						=			0
						lowerCAmelCase   :int						=			0
						lowerCAmelCase   :int

						while num_cuboids <= limit:
												max_cuboid_size += 1
												for sum_shortest_sides in range(2     ,      2 * max_cuboid_size + 1 ):
																		if sqrt(sum_shortest_sides**2 + max_cuboid_size**2 ).is_integer():
																								num_cuboids += (
																								    min(a__     ,      sum_shortest_sides // 2 )
																								    - max(1     ,      sum_shortest_sides - max_cuboid_size )
																								    + 1
																								)

						return max_cuboid_size


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