




from itertools import product




def 							_UpperCAmelCase     (UpperCamelCase_       :       int = 15				):
				'''simple docstring'''
				_lowerCAmelCase			:			float        =					0.0
				_lowerCAmelCase			:			float
				_lowerCAmelCase			:			int
				_lowerCAmelCase			:			int
				_lowerCAmelCase			:			int
				_lowerCAmelCase			:			int
				_lowerCAmelCase			:			tuple[int, ...]

				for series in product(range(2				)					,			repeat=UpperCamelCase_				):
								_lowerCAmelCase			:			Optional[Any]        =					series.count(1				)
								_lowerCAmelCase			:			List[Any]        =					num_turns - num_blue
								if num_red >= num_blue:
												continue
								_lowerCAmelCase			:			Any        =					1.0
								for ind, col in enumerate(UpperCamelCase_					,			2				):
												if col == 0:
																prob *= (ind - 1) / ind
												else:
																prob *= 1 / ind

								total_prob += prob

				return int(1 / total_prob				)


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






def        __a     (    lowerCAmelCase_   :					list				)      -> bool:






						'''simple docstring'''



						if not isinstance(lowerCAmelCase_			,lowerCAmelCase_				):
												raise ValueError("""Input series is not valid, valid series - [1, 2/3, 2]"""				)
						if len(lowerCAmelCase_				) == 0:
												raise ValueError("""Input list must be a non empty list"""				)
						if len(lowerCAmelCase_				) == 1 and series[0] != 0:
												return True
						UpperCAmelCase_=   []
						UpperCAmelCase_=   len(lowerCAmelCase_				)
						for i in range(0			,lowerCAmelCase_				):
												if series[i] == 0:
																		raise ValueError("""Input series cannot have 0 as an element"""				)
												rec_series.append(1 / series[i]				)
						UpperCAmelCase_=   rec_series[1] - rec_series[0]
						for index in range(2			,lowerCAmelCase_				):
												if rec_series[index] - rec_series[index - 1] != common_diff:
																		return False
						return True



def        __a     (    lowerCAmelCase_   :					list				)      -> float:






						'''simple docstring'''



						if not isinstance(lowerCAmelCase_			,lowerCAmelCase_				):
												raise ValueError("""Input series is not valid, valid series - [2, 4, 6]"""				)
						if len(lowerCAmelCase_				) == 0:
												raise ValueError("""Input list must be a non empty list"""				)
						UpperCAmelCase_=   0
						for val in series:
												answer += 1 / val
						return len(lowerCAmelCase_				) / answer


if __name__ == "__main__":
	import doctest

	doctest.testmod()




