You are given a football field in 3D space. A ball is initially placed at point $$$(x, y, z)$$$. In front of the ball, there is a goal — a rectangular box from point $$$(0, 0, 0)$$$ to $$$(A, B, C)$$$.
After a kick, the ball starts flying with initial speed $$$v$$$ in a direction defined by two angles:
At each moment of time $$$t \ge 0$$$, the position of the ball is given by:
$$$X(t) = x + v \cdot \cos(\phi) \cdot \cos(\theta) \cdot t$$$
$$$Y(t) = y + v \cdot \cos(\phi) \cdot \sin(\theta) \cdot t$$$
$$$Z(t) = z + v \cdot \sin(\phi) \cdot t - \frac{1}{2} \cdot g \cdot t^2$$$
where $$$g = 9.81$$$ and angles are converted to radians:
$$$\theta_\text{rad} = \theta \cdot \pi / 180$$$, $$$\phi_\text{rad} = \phi \cdot \pi / 180$$$.
You need to determine whether the ball will ever enter the goal volume.
The ball is considered inside the goal if at some moment $$$t \ge 0$$$ its position $$$(X(t), Y(t), Z(t))$$$ satisfies all of the following:
$$$0 \le X(t) \le A$$$, $$$0 \le Y(t) \le B$$$, $$$0 \le Z(t) \le C$$$
One line contains 9 real numbers:
$$$x,y,z,A,B,C, \theta,\phi,v$$$
Where:
All values are real numbers such that $$$(0 \le x,y,z,A, B, C, v \le 1000)$$$ , $$$(0 \le \theta \le 360)$$$ and $$$ (-90 \le \phi \le 90) $$$.
Print YES if the ball enters the goal at some moment. Otherwise, print NO.
10 10 10 30 30 30 180 0 10
YES
100 100 100 10 10 10 0 0 1
NO
| Name |
|---|


