





"""simple docstring"""
from cva import destroyAllWindows, imread, imshow, waitKey



def   __lowerCamelCase     (							a_  :	Tuple				,     a_  :	int							)    ->   str:
      __SCREAMING_SNAKE_CASE       ,__SCREAMING_SNAKE_CASE     :List[Any]	       =						img.shape[0], img.shape[1]

      def to_grayscale(a_  :	Tuple				,     a_  :	Union[str, Any]				,     a_  :	Union[str, Any]							):
            return 0.2126 * red + 0.587 * green + 0.114 * blue

      def normalize(a_  :	Tuple							):
            return min(a_				,     2_55							)

      for i in range(a_							):
            for j in range(a_							):
                  __SCREAMING_SNAKE_CASE     :Dict	       =						int(to_grayscale(*img[i][j]							)							)
                  __SCREAMING_SNAKE_CASE     :Optional[Any]	       =						[
                      normalize(a_							),
                      normalize(greyscale + factor							),
                      normalize(greyscale + 2 * factor							),
                  ]

      return img


if __name__ == "__main__":
  # read original image
  lowerCamelCase_          =	{
      percentage: imread("image_data/lena.jpg", 1) for percentage in (1_0, 2_0, 3_0, 4_0)
  }

  for percentage, img in images.items():
    make_sepia(img, percentage)

  for percentage, img in images.items():
    imshow(f'Original image with sepia (factor: {percentage})', img)

  waitKey(0)
  destroyAllWindows()






"""simple docstring"""
def   __lowerCamelCase     (							a_  :	int = 10**6							)    ->   int:

      if n <= 0:
            raise ValueError('''Please enter an integer greater than 0'''							)

      __SCREAMING_SNAKE_CASE     :Tuple	       =						list(range(n + 1							)							)
      for number in range(2				,     n + 1							):
            if phi[number] == number:
                  phi[number] -= 1
                  for multiple in range(number * 2				,     n + 1				,     a_							):
                        __SCREAMING_SNAKE_CASE     :List[Any]	       =						(phi[multiple] // number) * (number - 1)

      __SCREAMING_SNAKE_CASE     :Optional[Any]	       =						1
      for number in range(1				,     n + 1							):
            if (answer / phi[answer]) < (number / phi[number]):
                  __SCREAMING_SNAKE_CASE     :str	       =						number

      return answer


if __name__ == "__main__":
  print(solution())