
def 					lowerCAmelCase__     (    SCREAMING_SNAKE_CASE_			,				SCREAMING_SNAKE_CASE_			,				SCREAMING_SNAKE_CASE_			,				SCREAMING_SNAKE_CASE_	)							->						int:
			lowerCAmelCase__ : Dict   =						int((lower_bound + upper_bound) // 2	)
			if array[r] == value:
						return r
			if lower_bound >= upper_bound:
						return -1
			if array[r] < value:
						return binary_search(SCREAMING_SNAKE_CASE_			,				r + 1			,				SCREAMING_SNAKE_CASE_			,				SCREAMING_SNAKE_CASE_	)
			else:
						return binary_search(SCREAMING_SNAKE_CASE_			,				SCREAMING_SNAKE_CASE_			,				r - 1			,				SCREAMING_SNAKE_CASE_	)
def 					lowerCAmelCase__     (    SCREAMING_SNAKE_CASE_			,				SCREAMING_SNAKE_CASE_	)							->						list:
			lowerCAmelCase__ : Tuple   =						0
			if matrix[index][0] == value:
						return [index, 0]
			while index < len(SCREAMING_SNAKE_CASE_	) and matrix[index][0] < value:
						lowerCAmelCase__ : Tuple   =						binary_search(matrix[index]			,				0			,				len(matrix[index]	) - 1			,				SCREAMING_SNAKE_CASE_	)
						if r != -1:
									return [index, r]
						index += 1
			return [-1, -1]


if __name__ == "__main__":
					import doctest

					doctest.testmod()

lowerCamelCase__        =						[[0, 1, 1], [0, 0, 1], [1, 0, 0]]







class 	A__				:






				def __init__(		self   : Optional[int]       ,	a   : int  ):






							'''simple docstring'''







							lowerCAmelCase__ : List[str]   =						name
							lowerCAmelCase__ : List[Any]   =						[]
							lowerCAmelCase__ : int   =						[]






				def 				_lowerCamelCase						(		self   : List[str]       ,	a   : Union[str, Any]  ):






							'''simple docstring'''







							self.inbound.append(a  )






				def 				_lowerCamelCase						(		self   : Dict       ,	a   : Union[str, Any]  ):






							'''simple docstring'''







							self.outbound.append(a  )






				def __repr__(		self   : Tuple  ):






							'''simple docstring'''







							return f'''<node={self.name} inbound={self.inbound} outbound={self.outbound}>'''






def 					lowerCAmelCase__     (    SCREAMING_SNAKE_CASE_			,				SCREAMING_SNAKE_CASE_=3			,				SCREAMING_SNAKE_CASE_=0.85	)							->						Optional[Any]:
			lowerCAmelCase__ : Tuple   =						{}
			for node in nodes:
						lowerCAmelCase__ : Union[str, Any]   =						1

			lowerCAmelCase__ : List[str]   =						{}
			for node in nodes:
						lowerCAmelCase__ : str   =						len(node.outbound	)

			for i in range(SCREAMING_SNAKE_CASE_	):
						print(F'''======= Iteration {i + 1} ======='''	)
						for _, node in enumerate(SCREAMING_SNAKE_CASE_	):
									lowerCAmelCase__ : Optional[int]   =						(1 - d) + d * sum(
									    ranks[ib] / outbounds[ib] for ib in node.inbound	)
						print(SCREAMING_SNAKE_CASE_	)
def 					lowerCAmelCase__     (    )							->						Dict:
			lowerCAmelCase__ : List[Any]   =						list(input('Enter Names of the Nodes: '	).split()	)

			lowerCAmelCase__ : Union[str, Any]   =						[Node(SCREAMING_SNAKE_CASE_	) for name in names]

			for ri, row in enumerate(SCREAMING_SNAKE_CASE_	):
						for ci, col in enumerate(SCREAMING_SNAKE_CASE_	):
									if col == 1:
												nodes[ci].add_inbound(names[ri]	)
												nodes[ri].add_outbound(names[ci]	)

			print('======= Nodes ======='	)
			for node in nodes:
						print(SCREAMING_SNAKE_CASE_	)

			page_rank(SCREAMING_SNAKE_CASE_	)


if __name__ == "__main__":
					main()