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      __lowercase  (		lowerCamelCase      :  float						,						lowerCamelCase      :  float			):

 # Ensure valid instance
 if not isinstance(lowerCamelCase						,						(int, float)			):
  raise TypeError('Invalid velocity. Should be a positive number.'			)

 if not isinstance(lowerCamelCase						,						(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      __lowercase  (		lowerCamelCase      :  float						,						lowerCamelCase      :  float			):
 check_args(lowerCamelCase						,						lowerCamelCase			)
 UpperCamelCase_      :		Dict				=      angle_to_radians(2 * angle			)
 return round(init_velocity**2 * sin(lowerCamelCase			) / g						,						2			)





def      __lowercase  (		lowerCamelCase      :  float						,						lowerCamelCase      :  float			):
 check_args(lowerCamelCase						,						lowerCamelCase			)
 UpperCamelCase_      :		Optional[int]				=      angle_to_radians(lowerCamelCase			)
 return round(init_velocity**2 * sin(lowerCamelCase			) ** 2 / (2 * g)						,						2			)





def      __lowercase  (		lowerCamelCase      :  float						,						lowerCamelCase      :  float			):
 check_args(lowerCamelCase						,						lowerCamelCase			)
 UpperCamelCase_      :		List[str]				=      angle_to_radians(lowerCamelCase			)
 return round(2 * init_velocity * sin(lowerCamelCase			) / g						,						2			)





def      __lowercase  (		):
 UpperCamelCase_,				UpperCamelCase_      :		str				=      25, 20
 assert horizontal_distance(lowerCamelCase						,						lowerCamelCase			) == 4_0.9_7
 assert max_height(lowerCamelCase						,						lowerCamelCase			) == 3.7_3
 assert total_time(lowerCamelCase						,						lowerCamelCase			) == 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]""")




from __future__ import annotations

from collections import deque
from queue import Queue
from timeit import timeit

a_					      = {
    'A': ['B', 'C'],
    'B': ['A', 'D', 'E'],
    'C': ['A', 'F'],
    'D': ['B'],
    'E': ['B', 'F'],
    'F': ['C', 'E'],
}





def      __lowercase  (		lowerCamelCase      :  dict						,						lowerCamelCase      :  str			):
 UpperCamelCase_      :		Tuple				=      {start}
 UpperCamelCase_      :		Optional[Any]				=      [start]
 UpperCamelCase_      :		Queue				=      Queue()
 queue.put(lowerCamelCase			)
 while not queue.empty():
  UpperCamelCase_      :		Union[str, Any]				=      queue.get()
  for w in graph[v]:
   if w not in explored:
    explored.add(lowerCamelCase			)
    result.append(lowerCamelCase			)
    queue.put(lowerCamelCase			)
 return result





def      __lowercase  (		lowerCamelCase      :  dict						,						lowerCamelCase      :  str			):
 UpperCamelCase_      :		Dict				=      {start}
 UpperCamelCase_      :		Optional[int]				=      [start]
 UpperCamelCase_      :		Union[str, Any]				=      deque([start]			)
 while queue:
  UpperCamelCase_      :		Optional[int]				=      queue.popleft()
  for child in graph[v]:
   if child not in visited:
    visited.add(lowerCamelCase			)
    result.append(lowerCamelCase			)
    queue.append(lowerCamelCase			)
 return result





def      __lowercase  (		lowerCamelCase      :  str			):
 UpperCamelCase_      :		str				=      F"from __main__ import G, {name}"
 UpperCamelCase_      :		int				=      10000
 UpperCamelCase_      :		Optional[Any]				=      timeit(F"{name}(G, 'A')"						,						setup=lowerCamelCase						,						number=lowerCamelCase			)
 print(F"{name:<35} finished {number} runs in {res:.5f} seconds"			)


if __name__ == "__main__":
   import doctest

   doctest.testmod()

   benchmark_function('breadth_first_search')
   benchmark_function('breadth_first_search_with_deque')
   # breadth_first_search                finished 10000 runs in 0.20999 seconds
   # breadth_first_search_with_deque     finished 10000 runs in 0.01421 seconds



