






'''simple docstring'''







from __future__ import annotations

from math import pow, sqrt
def 						A__			(				__lowerCAmelCase		:			float   ,    __lowerCAmelCase		:			float   ,    __lowerCAmelCase		:			float						):
						if (resistance, reactance, impedance).count(0						) != 1:
												raise ValueError("""One and only one argument must be 0"""						)
						if resistance == 0:
												return {"resistance": sqrt(pow(__lowerCAmelCase   ,    2						) - pow(__lowerCAmelCase   ,    2						)						)}
						elif reactance == 0:
												return {"reactance": sqrt(pow(__lowerCAmelCase   ,    2						) - pow(__lowerCAmelCase   ,    2						)						)}
						elif impedance == 0:
												return {"impedance": sqrt(pow(__lowerCAmelCase   ,    2						) + pow(__lowerCAmelCase   ,    2						)						)}
						else:
												raise ValueError("""Exactly one argument must be 0"""						)


if __name__ == "__main__":
							import doctest

							doctest.testmod()









'''simple docstring'''







UpperCamelCase    :      Tuple  			=		[sum(int(c, 10) ** 2 for c in i.__str__()) for i in range(10_00_00)]
def 						A__			(				__lowerCAmelCase		:			int						):
						lowerCamelCase__         =  0
						while number:
												# Increased Speed Slightly by checking every 5 digits together.
												sum_of_digits_squared += DIGITS_SQUARED[number % 10_0000]
												number //= 10_0000

						return sum_of_digits_squared


# There are 2 Chains made,
# One ends with 89 with the chain member 58 being the one which when declared first,
# there will be the least number of iterations for all the members to be checked.

# The other one ends with 1 and has only one element 1.

# So 58 and 1 are chosen to be declared at the starting.

# Changed dictionary to an array to quicken the solution
UpperCamelCase    :      list[bool | None]  			=		[None] * 10_00_00_00
UpperCamelCase    :      Tuple  			=		True
UpperCamelCase    :      Optional[int]  			=		False
def 						A__			(				__lowerCAmelCase		:			int						):

						if CHAINS[number - 1] is not None:
												return CHAINS[number - 1]  # type: ignore

						lowerCamelCase__         =  chain(next_number(__lowerCAmelCase						)						)
						lowerCamelCase__         =  number_chain

						while number < 1000_0000:
												lowerCamelCase__         =  number_chain
												number *= 10

						return number_chain
def 						A__			(				__lowerCAmelCase		:			int = 1000_0000						):
						for i in range(1   ,    __lowerCAmelCase						):
												if CHAINS[i] is None:
																		chain(i + 1						)

						return CHAINS[:number].count(__lowerCAmelCase						)


if __name__ == "__main__":
							import doctest

							doctest.testmod()
							print(F'{solution() = }')

