





"""simple docstring"""


from math import sqrt

def      UpperCamelCase							(SCREAMING_SNAKE_CASE = 100_0000     ):
						UpperCamelCase				:		int				   =			0
						UpperCamelCase				:		int				   =			0
						UpperCamelCase				:		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(SCREAMING_SNAKE_CASE							,     sum_shortest_sides // 2     )
																								    - max(1							,     sum_shortest_sides - max_cuboid_size     )
																								    + 1
																								)

						return max_cuboid_size


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






from PIL import Image







def 						lowerCamelCase__      ( __A    :Image		):


       """simple docstring"""




       __snake_case	,    __snake_case       	=							image.size
       __snake_case       	=							0
       __snake_case       	=							image.load()
       for i in range(__A		):
              for j in range(__A		):
                     __snake_case       	=							pixels[j, i]
                     mean += pixel
       mean //= width * height

       for j in range(__A		):
              for i in range(__A		):
                     __snake_case       	=							2_5_5 if pixels[i, j] > mean else 0
       return image


if __name__ == "__main__":
    UpperCamelCase__		 =     mean_threshold(Image.open('''path_to_image''').convert('''L'''))
    image.save('''output_image_path''')

