






"""simple docstring"""
from __future__ import annotations






def 			__UpperCamelCase	(		snake_case__   ,   snake_case__					):
	if b == 0:
		return (1, 0)
	((A_)    ,     (A_))		:						Optional[int]	    =   extended_euclid(snake_case__   ,   a % b					)
	A_		:						Optional[Any]	    =   a // b
	return (y, x - k * y)






def 			__UpperCamelCase	(		snake_case__   ,   snake_case__   ,   snake_case__   ,   snake_case__					):
	((A_)    ,     (A_))		:						Optional[Any]	    =   extended_euclid(snake_case__   ,   snake_case__					)
	A_		:						int	    =   na * na
	A_		:						str	    =   ra * x * na + ra * y * na
	return (n % m + m) % m






def 			__UpperCamelCase	(		snake_case__   ,   snake_case__					):
	((A_)    ,     (A_))		:						List[Any]	    =   extended_euclid(snake_case__   ,   snake_case__					)
	if b < 0:
		A_		:						Optional[Any]	    =   (b % n + n) % n
	return b






def 			__UpperCamelCase	(		snake_case__   ,   snake_case__   ,   snake_case__   ,   snake_case__					):
	A_    ,     A_		:						Any	    =   invert_modulo(snake_case__   ,   snake_case__					), invert_modulo(snake_case__   ,   snake_case__					)
	A_		:						Optional[Any]	    =   na * na
	A_		:						List[str]	    =   ra * x * na + ra * y * na
	return (n % m + m) % m


if __name__ == "__main__":
							from doctest import testmod

							testmod(name="chinese_remainder_theorem", verbose=True)
							testmod(name="chinese_remainder_theorem2", verbose=True)
							testmod(name="invert_modulo", verbose=True)
							testmod(name="extended_euclid", verbose=True)









"""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()

