






"""simple docstring"""







from functools import lru_cache

@lru_cache
def _a (		_snake_case							):







      """simple docstring"""






      if not isinstance(_lowerCamelCase      ,       _lowerCamelCase							):
            raise TypeError("""k must be an integer."""							)
      if k < 0:
            raise ValueError("""k integer must be greater or equal to zero."""							)
      if k == 0:
            return 0
      elif k == 1:
            return 1
      else:
            return fibonacci(k - 1							) + fibonacci(k - 2							)

def _a (		_snake_case      ,       _snake_case							):







      """simple docstring"""






      UpperCAmelCase							=       len(_lowerCamelCase							)
      # Find m such that F_m >= n where F_i is the i_th fibonacci number.
      UpperCAmelCase							=       0
      while True:
            if fibonacci(_lowerCamelCase							) >= len_list:
                  UpperCAmelCase							=       i
                  break
            i += 1
      UpperCAmelCase							=       0
      while fibb_k > 0:
            UpperCAmelCase							=       min(
                offset + fibonacci(fibb_k - 1							)      ,       len_list - 1							)  # Prevent out of range
            UpperCAmelCase							=       arr[index_k]
            if item_k_1 == val:
                  return index_k
            elif val < item_k_1:
                  fibb_k -= 1
            elif val > item_k_1:
                  offset += fibonacci(fibb_k - 1							)
                  fibb_k -= 2
      else:
            return -1


if __name__ == "__main__":
  import doctest

  doctest.testmod()











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






def        lowerCamelCase_  (						_lowerCamelCase			,   _lowerCamelCase				):
 lowerCamelCase__				,     lowerCamelCase__     :			Optional[Any]     				=						img.shape[0], img.shape[1]

 def to_grayscale(_lowerCamelCase			,   _lowerCamelCase			,   _lowerCamelCase				):
  return 0.2_126 * red + 0.587 * green + 0.114 * blue

 def normalize(_lowerCamelCase				):
  return min(_lowerCamelCase			,   255				)

 for i in range(_lowerCamelCase				):
  for j in range(_lowerCamelCase				):
   lowerCamelCase__     :			List[Any]     				=						int(to_grayscale(*img[i][j]				)				)
   lowerCamelCase__     :			Optional[int]     				=						[
       normalize(_lowerCamelCase				),
       normalize(greyscale + factor				),
       normalize(greyscale + 2 * factor				),
   ]

 return img


if __name__ == "__main__":
      # read original image
      A_			: List[str]				=			{
          percentage: imread("image_data/lena.jpg", 1) for percentage in (10, 20, 30, 40)
      }

      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()

