The Amazing Human Cannonball

This commit is contained in:
2023-07-16 21:09:36 +02:00
parent 95aa076e8f
commit 2d740cf8d3

12
humancannonball2.py Normal file
View File

@@ -0,0 +1,12 @@
from math import cos, sin, radians
n = int(input())
for _ in range(n):
v0, angle, x1, h1, h2 = map(float, input().split())
t = x1 / v0 / cos(radians(angle))
yt = v0 * t * sin(radians(angle)) - 0.5 * 9.81 * t**2
if h1 + 1 < yt < h2 - 1:
print("Safe")
else:
print("Not Safe")