






__lowerCamelCase						= {
    '0': 1,
    '1': 1,
    '2': 2,
    '3': 6,
    '4': 24,
    '5': 120,
    '6': 720,
    '7': 5_040,
    '8': 40_320,
    '9': 362_880,
}

__lowerCamelCase						= {145: 145}

__lowerCamelCase						= {
    145: 0,
    169: 3,
    36_301: 3,
    1_454: 3,
    871: 2,
    45_361: 2,
    872: 2,
}






def    UpperCamelCase__  (   UpperCAmelCase     )     ->		int:







							"""simple docstring"""





							if n in CACHE_SUM_DIGIT_FACTORIALS:
														return CACHE_SUM_DIGIT_FACTORIALS[n]
							_a  :    Union[str, Any]			=						sum(DIGIT_FACTORIALS[let] for let in str(UpperCAmelCase     )     )
							_a  :    Dict			=						ret
							return ret






def    UpperCamelCase__  (   UpperCAmelCase    ,	UpperCAmelCase = None     )     ->		int:







							"""simple docstring"""





							_a  :    int			=						previous or set()
							if n in CHAIN_LENGTH_CACHE:
														return CHAIN_LENGTH_CACHE[n]
							_a  :    Tuple			=						sum_digit_factorials(UpperCAmelCase     )
							if next_number in previous:
														_a  :    Union[str, Any]			=						0
														return 0
							else:
														previous.add(UpperCAmelCase     )
														_a  :    str			=						1 + chain_length(UpperCAmelCase    ,	UpperCAmelCase     )
														_a  :    List[str]			=						ret
														return ret






def    UpperCamelCase__  (   UpperCAmelCase = 60    ,	UpperCAmelCase = 1000000     )     ->		int:







							"""simple docstring"""





							return sum(1 for i in range(1    ,	UpperCAmelCase     ) if chain_length(UpperCAmelCase     ) == num_terms     )


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







from math import radians as angle_to_radians
from math import sin

# Acceleration Constant on Earth (unit m/s^2)
__lowerCamelCase						= 9.8_06_65






def    UpperCamelCase__  (   UpperCAmelCase    ,	UpperCAmelCase     )     ->		None:







							"""simple docstring"""





							if not isinstance(UpperCAmelCase    ,	(int, float)     ):
														raise TypeError('''Invalid velocity. Should be a positive number.'''     )

							if not isinstance(UpperCAmelCase    ,	(int, float)     ):
														raise TypeError('''Invalid angle. Range is 1-90 degrees.'''     )

							# Ensure valid angle
							if angle > 90 or angle < 1:
														raise ValueError('''Invalid angle. Range is 1-90 degrees.'''     )

							# Ensure valid velocity
							if init_velocity < 0:
														raise ValueError('''Invalid velocity. Should be a positive number.'''     )






def    UpperCamelCase__  (   UpperCAmelCase    ,	UpperCAmelCase     )     ->		float:







							"""simple docstring"""





							check_args(UpperCAmelCase    ,	UpperCAmelCase     )
							_a  :    Dict			=						angle_to_radians(2 * angle     )
							return round(init_velocity**2 * sin(UpperCAmelCase     ) / g    ,	2     )






def    UpperCamelCase__  (   UpperCAmelCase    ,	UpperCAmelCase     )     ->		float:







							"""simple docstring"""





							check_args(UpperCAmelCase    ,	UpperCAmelCase     )
							_a  :    Union[str, Any]			=						angle_to_radians(UpperCAmelCase     )
							return round(init_velocity**2 * sin(UpperCAmelCase     ) ** 2 / (2 * g)    ,	2     )






def    UpperCamelCase__  (   UpperCAmelCase    ,	UpperCAmelCase     )     ->		float:







							"""simple docstring"""





							check_args(UpperCAmelCase    ,	UpperCAmelCase     )
							_a  :    str			=						angle_to_radians(UpperCAmelCase     )
							return round(2 * init_velocity * sin(UpperCAmelCase     ) / g    ,	2     )






def    UpperCamelCase__  (   )     ->		None:







							"""simple docstring"""





							_a		,					_a  :    Any			=						25, 20
							assert horizontal_distance(UpperCAmelCase    ,	UpperCAmelCase     ) == 4_0.9_7
							assert max_height(UpperCAmelCase    ,	UpperCAmelCase     ) == 3.7_3
							assert total_time(UpperCAmelCase    ,	UpperCAmelCase     ) == 1.7_4


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

						testmod()

						# Get input from user
						__lowerCamelCase						= float(input('Initial Velocity: ').strip())

						# Get input from user
						__lowerCamelCase						= float(input('angle: ').strip())

						# Print results
						print()
						print('Results: ')
						print(F'''Horizontal Distance: {horizontal_distance(init_vel, angle)!s} [m]''')
						print(F'''Maximum Height: {max_height(init_vel, angle)!s} [m]''')
						print(F'''Total Time: {total_time(init_vel, angle)!s} [s]''')