
from __future__ import annotations





class 						lowercase       :
					def __init__(		self ,	SCREAMING_SNAKE_CASE__ = 0    ):
								"""simple docstring"""







								lowerCAmelCase__ :    Optional[Any]				      =			value
								lowerCAmelCase__ :    Node | None				      =			None
								lowerCAmelCase__ :    Node | None				      =			None





def      _a     (   __UpperCamelCase       :  Node | None	,__UpperCamelCase       :  Node | None    ):
			if treea is None:
						return treea
			if treea is None:
						return treea

			lowerCAmelCase__ :    Optional[int]				      =			treea.value + treea.value
			lowerCAmelCase__ :    Any				      =			merge_two_binary_trees(treea.left	,treea.left    )
			lowerCAmelCase__ :    Tuple				      =			merge_two_binary_trees(treea.right	,treea.right    )
			return treea



def      _a     (   __UpperCamelCase       :  Node | None    ):
			if root:
						print(root.value    )
						print_preorder(root.left    )
						print_preorder(root.right    )


if __name__ == "__main__":
							A__       :   Any   						=					Node(1)
							A__       :   str   						=					Node(2)
							A__       :   int   						=					Node(3)
							A__       :   Union[str, Any]   						=					Node(4)

							A__       :   Any   						=					Node(2)
							A__       :   List[str]   						=					Node(4)
							A__       :   str   						=					Node(6)
							A__       :   Tuple   						=					Node(9)
							A__       :   Any   						=					Node(5)

							print("""Tree1 is: """)
							print_preorder(treea)
							print("""Tree2 is: """)
							print_preorder(treea)
							A__       :   str   						=					merge_two_binary_trees(treea, treea)
							print("""Merged Tree is: """)
							print_preorder(merged_tree)





from math import radians as angle_to_radians
from math import sin

# Acceleration Constant on Earth (unit m/s^2)
A__       :   str   						=					9.8_0665



def      _a     (   __UpperCamelCase       :  float	,__UpperCamelCase       :  float    ):

			# Ensure valid instance
			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      _a     (   __UpperCamelCase       :  float	,__UpperCamelCase       :  float    ):
			check_args(__UpperCamelCase	,__UpperCamelCase    )
			lowerCAmelCase__ :    Union[str, Any]				      =			angle_to_radians(2 * angle    )
			return round(init_velocity**2 * sin(__UpperCamelCase    ) / g	,2    )



def      _a     (   __UpperCamelCase       :  float	,__UpperCamelCase       :  float    ):
			check_args(__UpperCamelCase	,__UpperCamelCase    )
			lowerCAmelCase__ :    List[str]				      =			angle_to_radians(__UpperCamelCase    )
			return round(init_velocity**2 * sin(__UpperCamelCase    ) ** 2 / (2 * g)	,2    )



def      _a     (   __UpperCamelCase       :  float	,__UpperCamelCase       :  float    ):
			check_args(__UpperCamelCase	,__UpperCamelCase    )
			lowerCAmelCase__ :    Dict				      =			angle_to_radians(__UpperCamelCase    )
			return round(2 * init_velocity * sin(__UpperCamelCase    ) / g	,2    )



def      _a     (   ):
			lowerCAmelCase__      ,				lowerCAmelCase__ :    List[Any]				      =			25, 20
			assert horizontal_distance(__UpperCamelCase	,__UpperCamelCase    ) == 40.97
			assert max_height(__UpperCamelCase	,__UpperCamelCase    ) == 3.73
			assert total_time(__UpperCamelCase	,__UpperCamelCase    ) == 1.74


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

							testmod()

							# Get input from user
							A__       :   List[Any]   						=					float(input("""Initial Velocity: """).strip())

							# Get input from user
							A__       :   Optional[Any]   						=					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]""")



