Logo
(追記) (追記ここまで)

24775번 - The Amazing Human Cannonball 다국어

시간 제한메모리 제한제출정답맞힌 사람정답 비율
1 초 (추가 시간 없음) 1024 MB75716295.385%

문제

The amazing human cannonball show is coming to town, and you are asked to double-check their calculations to make sure no one gets injured! The human cannonball is fired from a cannon that is a distance $x_1$ from a vertical wall with a hole through which the cannonball must fly. The lower edge of the hole is at height $h_1$ and the upper edge is at height $h_2$. The initial velocity of the cannonball is given as $v_0$ and you also know the angle $\theta$ of the cannon relative to the ground.

Thanks to their innovative suits, human cannonballs can fly without air resistance, and thus their trajectory can be modeled using the following formulas: \begin{eqnarray*} x(t) & = & v_0 t \cos{\theta} \\ y(t) & = & v_0 t \sin{\theta} - \frac{1}{2} g t^2 \end{eqnarray*} where $x(t), y(t)$ provides the position of a cannon ball at time $t$ that is fired from point $(0, 0)$. $g$ is the acceleration due to gravity ($g = 9.81\ m/s^2$).

Write a program to determine if the human cannonball can make it safely through the hole in the wall. To pass safely, there has to be a vertical safety margin of 1ドルm$ both below and above the point where the ball's trajectory crosses the centerline of the wall.

입력

The input will consist of up to 100ドル$ test cases. The first line contains an integer $N,ドル denoting the number of test cases that follow. Each test case has 5 parameters: $v_0 \ \theta \ x_1 \ h_1 \ h_2,ドル separated by spaces. $v_0$ (0ドル < v_0 \le 200$) represents the ball's initial velocity in $m/s$. $\theta$ is an angle given in degrees (0ドル < \theta < 90$), $x_1$ (0ドル < x_1 < 1000$) is the distance from the cannon to the wall, $h_1$ and $h_2$ (0ドル < h_1 < h_2 < 1000$) are the heights of the lower and upper edges of the wall. All numbers are floating point numbers.

출력

If the cannon ball can safely make it through the wall, output "Safe". Otherwise, output "Not Safe"!

제한

예제 입력 1

11
19 45 20 9 12
20 45 20 9 12
25 45 20 9 12
20 43 20 9 12
20 47.5 20 9 12
20 45 17 9 12
20 45 24 9 12
20 45 20 10 12
20 45 20 9 11
20 45 20 9.0 11.5
20 45 18.1 9 12

예제 출력 1

Not Safe
Safe
Not Safe
Not Safe
Not Safe
Not Safe
Not Safe
Not Safe
Not Safe
Safe
Safe

힌트

출처

School > Virginia Tech High School Programming Contest > 2015 Virginia Tech High School Programming Contest A번

  • 문제를 만든 사람: Godmar Back
(追記) (追記ここまで)

출처

대학교 대회

  • 사업자 등록 번호: 541-88-00682
  • 대표자명: 최백준
  • 주소: 서울시 서초구 서초대로74길 29 서초파라곤 412호
  • 전화번호: 02-521-0487 (이메일로 연락 주세요)
  • 이메일: contacts@startlink.io
  • 통신판매신고번호: 제 2017-서울서초-2193 호

AltStyle によって変換されたページ (->オリジナル) /