Skip to content

Commit c8e8f9f

Browse files
authored
Difficulty: Easy
1 parent 8912934 commit c8e8f9f

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
'''
2+
https://open.kattis.com/problems/humancannonball2
3+
'''
4+
5+
import math
6+
7+
testcases = int(input())
8+
for i in range(testcases):
9+
v,o,x,h1,h2 = map(float,input().split())
10+
t = x/(v*math.cos(math.radians(o)))
11+
y = v*t*math.sin(math.radians(o)) - (0.5*9.81*(t**2))
12+
if y < h2-1 and y > h1+1:
13+
print("Safe")
14+
else:
15+
print("Not Safe")

0 commit comments

Comments
 (0)