


def   A   (		A__		,		A__ ):
     UpperCAmelCase						:				List[Any]		  =			sorted(A__		,		key=lambda A__ : edge[2] )

     UpperCAmelCase						:				Optional[Any]		  =			list(range(A__ ) )

     def find_parent(A__ ):
          if i != parent[i]:
               UpperCAmelCase						:				List[str]		  =			find_parent(parent[i] )
          return parent[i]

     UpperCAmelCase						:				Any		  =			0
     UpperCAmelCase						:				Tuple		  =			[]

     for edge in edges:
          UpperCAmelCase						:				Union[str, Any]		  =			find_parent(edge[0] )
          UpperCAmelCase						:				Optional[Any]		  =			find_parent(edge[1] )
          if parent_a != parent_b:
               minimum_spanning_tree_cost += edge[2]
               minimum_spanning_tree.append(A__ )
               UpperCAmelCase						:				Union[str, Any]		  =			parent_b

     return minimum_spanning_tree


if __name__ == "__main__":  # pragma: no cover
      _snake_case ,						_snake_case   = list(map(int, input().strip().split()))
      _snake_case   = []

      for _ in range(num_edges):
            _snake_case ,						_snake_case ,						_snake_case   = (int(x) for x in input().strip().split())
            edges.append((nodea, nodea, cost))

      kruskal(num_nodes, edges)







from cva import destroyAllWindows, imread, imshow, waitKey







def   A   (		A__		,		A__ ):
     UpperCAmelCase  , UpperCAmelCase						:				Optional[Any]		  =			img.shape[0], img.shape[1]

     def to_grayscale(A__		,		A__		,		A__ ):
          return 0.2126 * red + 0.587 * green + 0.114 * blue

     def normalize(A__ ):
          return min(A__		,		2_5_5 )

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

     return img


if __name__ == "__main__":
      # read original image
      _snake_case   = {
          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()



