





from math import radians as angle_to_radians
from math import sin

# Acceleration Constant on Earth (unit m/s^2)
_a									=				9.80_665





def lowerCAmelCase__(__snake_case	,__snake_case							)    ->				Union[str, Any]:







	'''simple docstring'''







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

	if not isinstance(lowercase__	,(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 lowerCAmelCase__(__snake_case	,__snake_case							)    ->				Any:







	'''simple docstring'''







	check_args(lowercase__	,lowercase__							)
	lowerCamelCase__        =		angle_to_radians(2 * angle							)
	return round(init_velocity**2 * sin(lowercase__							) / g	,2							)





def lowerCAmelCase__(__snake_case	,__snake_case							)    ->				Optional[Any]:







	'''simple docstring'''







	check_args(lowercase__	,lowercase__							)
	lowerCamelCase__        =		angle_to_radians(lowercase__							)
	return round(init_velocity**2 * sin(lowercase__							) ** 2 / (2 * g)	,2							)





def lowerCAmelCase__(__snake_case	,__snake_case							)    ->				Any:







	'''simple docstring'''







	check_args(lowercase__	,lowercase__							)
	lowerCamelCase__        =		angle_to_radians(lowercase__							)
	return round(2 * init_velocity * sin(lowercase__							) / g	,2							)





def lowerCAmelCase__()    ->				Optional[int]:







	'''simple docstring'''







	lowerCamelCase__        =		25, 20
	assert horizontal_distance(lowercase__	,lowercase__							) == 4_0.9_7
	assert max_height(lowercase__	,lowercase__							) == 3.7_3
	assert total_time(lowercase__	,lowercase__							) == 1.7_4


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

			testmod()

			# Get input from user
			_a									=				float(input("Initial Velocity: ").strip())

			# Get input from user
			_a									=				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]""")










import os





def lowerCAmelCase__()    ->				int:







	'''simple docstring'''







	lowerCamelCase__        =		os.path.dirname(os.path.realpath(__snake_case							)							)
	lowerCamelCase__        =		os.path.join(__snake_case	,'''triangle.txt'''							)

	with open(__snake_case							) as in_file:
		lowerCamelCase__        =		[[int(__snake_case							) for i in line.split()] for line in in_file]

	while len(__snake_case							) != 1:
		lowerCamelCase__        =		triangle.pop()
		lowerCamelCase__        =		triangle[-1]
		for j in range(len(__snake_case							) - 1							):
			curr_row[j] += max(last_row[j]	,last_row[j + 1]							)
	return triangle[0][0]


if __name__ == "__main__":
			print(solution())



