






"""simple docstring"""
def 			__UpperCamelCase	(		snake_case__					):

	'''simple docstring'''





	A_		:						Any	    =   [0] * len(snake_case__					)

	for i in range(1   ,   len(snake_case__					)					):
		# use last results for better performance - dynamic programming
		A_		:						List[str]	    =   prefix_result[i - 1]
		while j > 0 and input_string[i] != input_string[j]:
			A_		:						Dict	    =   prefix_result[j - 1]

		if input_string[i] == input_string[j]:
			j += 1
		A_		:						Optional[Any]	    =   j

	return prefix_result






def 			__UpperCamelCase	(		snake_case__					):

	'''simple docstring'''





	return max(prefix_function(snake_case__					)					)


if __name__ == "__main__":
							import doctest

							doctest.testmod()









"""simple docstring"""
import math






def 			__UpperCamelCase	(		snake_case__   ,   snake_case__					):
	if (
	    not isinstance(snake_case__   ,   (int, float)					)
	    or power_factor < -1
	    or power_factor > 1
	):
		raise ValueError("""power_factor must be a valid float value between -1 and 1."""					)
	return apparent_power * power_factor






def 			__UpperCamelCase	(		snake_case__   ,   snake_case__					):
	if (
	    not isinstance(snake_case__   ,   (int, float)					)
	    or power_factor < -1
	    or power_factor > 1
	):
		raise ValueError("""power_factor must be a valid float value between -1 and 1."""					)
	return apparent_power * math.sqrt(1 - power_factor**2					)


if __name__ == "__main__":
							import doctest

							doctest.testmod()

