

def 			A_      (    _UpperCAmelCase    ):
						SCREAMING_SNAKE_CASE_: Union[str, Any]  		=       (1 + 24 * n) ** 0.5
						return ((1 + root) / 6) % 1 == 0







def 			A_      (    _UpperCAmelCase = 50_00    ):
						SCREAMING_SNAKE_CASE_: str  		=       [(i * (3 * i - 1)) // 2 for i in range(1				,	_UpperCAmelCase    )]
						for i, pentagonal_i in enumerate(_UpperCAmelCase    ):
												for j in range(_UpperCAmelCase				,	len(_UpperCAmelCase    )    ):
																		SCREAMING_SNAKE_CASE_: Dict  		=       pentagonal_nums[j]
																		SCREAMING_SNAKE_CASE_: List[Any]  		=       pentagonal_i + pentagonal_j
																		SCREAMING_SNAKE_CASE_: str  		=       pentagonal_j - pentagonal_i
																		if is_pentagonal(_UpperCAmelCase    ) and is_pentagonal(_UpperCAmelCase    ):
																								return b

						return -1


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










from PIL import Image

def       lowercase_		(		_A			:    Image						):

      """simple docstring"""




      lowerCamelCase__    ,   lowerCamelCase__		:				List[str]    =  image.size
      lowerCamelCase__		:				Dict    =  0
      lowerCamelCase__		:				Dict    =  image.load()
      for i in range(_A						):
            for j in range(_A						):
                  lowerCamelCase__		:				List[str]    =  pixels[j, i]
                  mean += pixel
      mean //= width * height

      for j in range(_A						):
            for i in range(_A						):
                  lowerCamelCase__		:				Union[str, Any]    =  255 if pixels[i, j] > mean else 0
      return image


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


