Files
kattis/humancannonball2.py

13 lines
312 B
Python

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")