Beach Volleyball

[image]

Roger and his friends like to play beach volleyball, which is played on
a sand court that measures 16 × 8 meters (shown in the figure). The
court is divided by a net whose height is 2.43 meters. It is Roger’s
turn to serve, and he wants to know how hard he should hit the ball and
in what direction. Roger is standing exactly in the middle of the base
line (marked with an X in the figure), and the ball is initially 2
meters above the ground. A hit is successful if the ball passes over the
net and lands on the opposite side within the bounds of the court.

Input

An integer 1 ≤ N ≤ 100000 denoting the number of test cases. Each test
case consists of three real numbers 0 < X, Y, Z ≤ 10 describing the
initial velocity of the ball. Here, X is the velocity along the length
of the court, Y is the velocity along the width of the court (because of
symmetry this could be either left or right), and Z is the vertical
velocity. All velocities are measured in m/s, and the X and Y velocities
are constant, but the Z velocity is affected by gravity, which is
approximately 10 m/s².

Output

For each test case, a single line with the number "1" if the hit is
successful, and "0" otherwise.

Observation

Given initial height h₀ and initial vertical velocity Z, the height of
the ball after t seconds is h = h₀ + Zt − gt²/2, where g is gravity.

Problem information

Author: Anders Jonsson

Generation: 2026-01-25T13:47:48.764Z

© Jutge.org, 2006–2026.
https://jutge.org
