





"""simple docstring"""





from __future__ import annotations

class 		lowercase :





      def __init__(	self				,						lowercase			)		->					None:
            lowerCAmelCase  						=	vertices
            lowerCAmelCase  						=	[[0] * vertices for _ in range(lowercase			)]





      def    _snake_case      (	self				,						lowercase			)		->					None:
            print("""Vertex \t Distance from Source"""			)
            for vertex in range(self.vertices			):
                  print(lowercase				,						"""\t\t"""				,						distances_from_source[vertex]			)





      def    _snake_case      (	self				,						lowercase				,						lowercase			)		->					int:
            lowerCAmelCase  						=	1e7
            lowerCAmelCase  						=	0

            # Search not nearest vertex not in the shortest path tree
            for vertex in range(self.vertices			):
                  if distances_from_source[vertex] < minimum and visited[vertex] is False:
                        lowerCAmelCase  						=	distances_from_source[vertex]
                        lowerCAmelCase  						=	vertex
            return min_index





      def    _snake_case      (	self				,						lowercase			)		->					None:
            lowerCAmelCase  						=	[int(1e7			)] * self.vertices  # distances from the source
            lowerCAmelCase  						=	0
            lowerCAmelCase  						=	[False] * self.vertices

            for _ in range(self.vertices			):
                  lowerCAmelCase  						=	self.minimum_distance(lowercase				,						lowercase			)
                  lowerCAmelCase  						=	True

                  # Update dist value of the adjacent vertices
                  # of the picked vertex only if the current
                  # distance is greater than new distance and
                  # the vertex in not in the shortest path tree
                  for v in range(self.vertices			):
                        if (
                            self.graph[u][v] > 0
                            and visited[v] is False
                            and distances[v] > distances[u] + self.graph[u][v]
                        ):
                              lowerCAmelCase  						=	distances[u] + self.graph[u][v]

            self.print_solution(lowercase			)


if __name__ == "__main__":
       SCREAMING_SNAKE_CASE__ =       Graph(9)
       SCREAMING_SNAKE_CASE__ =       [
           [0, 4, 0, 0, 0, 0, 0, 8, 0],
           [4, 0, 8, 0, 0, 0, 0, 11, 0],
           [0, 8, 0, 7, 0, 4, 0, 0, 2],
           [0, 0, 7, 0, 9, 14, 0, 0, 0],
           [0, 0, 0, 9, 0, 10, 0, 0, 0],
           [0, 0, 4, 14, 10, 0, 2, 0, 0],
           [0, 0, 0, 0, 0, 2, 0, 1, 6],
           [8, 11, 0, 0, 0, 0, 1, 0, 7],
           [0, 0, 2, 0, 0, 0, 6, 7, 0],
       ]
       graph.dijkstra(0)













"""simple docstring"""





def       UpperCAmelCase__							(  SCREAMING_SNAKE_CASE					:						int							,						SCREAMING_SNAKE_CASE					:						int      ):







      '''simple docstring'''




      lowerCAmelCase  						=	1.0
      for i in range(1							,						r + 1      ):
            ret *= (n + 1 - i) / i
      return round(SCREAMING_SNAKE_CASE      )


def       UpperCAmelCase__							(  SCREAMING_SNAKE_CASE					:						int      ):







      '''simple docstring'''




      return choose(8 + n							,						SCREAMING_SNAKE_CASE      ) + choose(9 + n							,						SCREAMING_SNAKE_CASE      ) - 10


def       UpperCAmelCase__							(  SCREAMING_SNAKE_CASE					:						int      ):







      '''simple docstring'''




      return sum(non_bouncy_exact(SCREAMING_SNAKE_CASE      ) for i in range(1							,						n + 1      )      )


def       UpperCAmelCase__							(  SCREAMING_SNAKE_CASE					:						int = 1_00      ):







      '''simple docstring'''




      return non_bouncy_upto(SCREAMING_SNAKE_CASE      )


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






