

from __future__ import annotations



def       __lowerCAmelCase      (						A       ,     A    ):
	if nth_term == "":
		return [""]
	UpperCAmelCase_       				=			int(A    )
	UpperCAmelCase_       				=			int(A    )
	UpperCAmelCase_       				=			[]
	for temp in range(int(A    )    ):
		series.append(F"1 / {pow(temp + 1       ,     int(A    )    )}" if series else "1"    )
	return series


if __name__ == "__main__":
				import doctest

				doctest.testmod()

				_a:    Optional[Any] 							=			int(input("""Enter the last number (nth term) of the P-Series"""))
				_a:    Any 							=			int(input("""Enter the power for  P-Series"""))
				print("""Formula of P-Series => 1+1/2^p+1/3^p ..... 1/n^p""")
				print(p_series(nth_term, power))


from __future__ import annotations

from collections import Counter
from random import random

class 						__UpperCamelCase    :




	def __init__(		self	:						Any							):


		'''simple docstring'''







		UpperCAmelCase_       				=			{}




	def       __A					(		self	:						List[str]		,	lowerCAmelCase	:						str							):


		'''simple docstring'''







		UpperCAmelCase_       				=			{}




	def       __A					(		self	:						Union[str, Any]		,	lowerCAmelCase	:						str		,	lowerCAmelCase	:						str		,	lowerCAmelCase	:						float							):


		'''simple docstring'''







		if nodea not in self.connections:
			self.add_node(lowerCAmelCase							)
		if nodea not in self.connections:
			self.add_node(lowerCAmelCase							)
		UpperCAmelCase_       				=			probability




	def       __A					(		self	:						Tuple							):


		'''simple docstring'''







		return list(self.connections							)




	def       __A					(		self	:						str		,	lowerCAmelCase	:						str							):


		'''simple docstring'''







		UpperCAmelCase_       				=			0
		UpperCAmelCase_       				=			random()

		for dest in self.connections[node]:
			current_probability += self.connections[node][dest]
			if current_probability > random_value:
				return dest
		return ""



def       __lowerCAmelCase      (						A       ,     A       ,     A    ):
	UpperCAmelCase_       				=			MarkovChainGraphUndirectedUnweighted()

	for nodea, nodea, probability in transitions:
		graph.add_transition_probability(A       ,     A       ,     A    )

	UpperCAmelCase_       				=			Counter(graph.get_nodes()    )
	UpperCAmelCase_       				=			start

	for _ in range(A    ):
		UpperCAmelCase_       				=			graph.transition(A    )
		visited[node] += 1

	return visited


if __name__ == "__main__":
				import doctest

				doctest.testmod()