



def       UpperCamelCase(  __UpperCamelCase							:		int					,__UpperCamelCase							:		List[str]			):
		lowerCAmelCase_      :					List[str]     =			len(__UpperCamelCase			)
		# Create a stack and push index of fist element to it
		lowerCAmelCase_      :					str     =			[]
		st.append(0			)

		# Span value of first element is always 1
		lowerCAmelCase_      :					List[str]     =			1

		# Calculate span values for rest of the elements
		for i in range(1					,__UpperCamelCase			):
				# Pop elements from stack while stack is not
				# empty and top of stack is smaller than price[i]
				while len(__UpperCamelCase			) > 0 and price[st[0]] <= price[i]:
						st.pop()

				# If stack becomes empty, then price[i] is greater
				# than all elements on left of it, i.e. price[0],
				# price[1], ..price[i-1]. Else the price[i]  is
				# greater than elements after top of stack
				lowerCAmelCase_      :					Optional[int]     =			i + 1 if len(__UpperCamelCase			) <= 0 else (i - st[0])

				# Push this element to stack
				st.append(__UpperCamelCase			)


def       UpperCamelCase(  __UpperCamelCase							:		int					,__UpperCamelCase							:		Union[str, Any]			):
		for i in range(0					,__UpperCamelCase			):
				print(arr[i]					,end=''' '''			)


# Driver program to test above function
A__  :  Any       = [10, 4, 5, 90, 120, 80]
A__  :  Dict       = [0 for i in range(len(price) + 1)]

# Fill the span values in array S[]
calculation_span(price, S)





print_array(S, len(price))










from math import radians as angle_to_radians
from math import sin

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


def       UpperCamelCase(  __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       UpperCamelCase(  __UpperCamelCase							:		float					,__UpperCamelCase							:		float			):
		check_args(__UpperCamelCase					,__UpperCamelCase			)
		lowerCAmelCase_      :					Optional[Any]     =			angle_to_radians(2 * angle			)
		return round(init_velocity**2 * sin(__UpperCamelCase			) / g					,2			)


def       UpperCamelCase(  __UpperCamelCase							:		float					,__UpperCamelCase							:		float			):
		check_args(__UpperCamelCase					,__UpperCamelCase			)
		lowerCAmelCase_      :					Any     =			angle_to_radians(__UpperCamelCase			)
		return round(init_velocity**2 * sin(__UpperCamelCase			) ** 2 / (2 * g)					,2			)


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


def       UpperCamelCase(  ):
		lowerCAmelCase_ ,  lowerCAmelCase_      :					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
						A__  :  List[Any]       = float(input('''Initial Velocity: ''').strip())

						# Get input from user
						A__  :  Dict       = 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]''')





