



from math import ceil






def 				A				(					_lowerCamelCase = 1_001  ):





							'''simple docstring'''




							_lowerCAmelCase     :							int    =    1

							for i in range(1				, int(ceil(n / 2.0  )  )  ):
														_lowerCAmelCase     :							List[Any]    =    2 * i + 1
														_lowerCAmelCase     :							str    =    2 * i
														_lowerCAmelCase     :							List[str]    =    total + 4 * odd**2 - 6 * even

							return total


if __name__ == "__main__":
						import sys

						if len(sys.argv) == 1:
												print(solution())
						else:
												try:
																		_snake_case		=  int(sys.argv[1])
																		print(solution(n))
												except ValueError:
																		print("Invalid entry - please enter a number")





from PIL import Image






def 				A				(					_lowerCamelCase  ):





							'''simple docstring'''




							_lowerCAmelCase   ,    _lowerCAmelCase     :							int    =    image.size
							_lowerCAmelCase     :							Any    =    0
							_lowerCAmelCase     :							Tuple    =    image.load()
							for i in range(_lowerCamelCase  ):
														for j in range(_lowerCamelCase  ):
																					_lowerCAmelCase     :							Union[str, Any]    =    pixels[j, i]
																					mean += pixel
							mean //= width * height

							for j in range(_lowerCamelCase  ):
														for i in range(_lowerCamelCase  ):
																					_lowerCAmelCase     :							Optional[Any]    =    255 if pixels[i, j] > mean else 0
							return image


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