Beach Volleyball X14814


Statement
 

pdf   zip

html

[r]

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/s2.

Output

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

Observation

Given initial height h0 and initial vertical velocity Z, the height of the ball after t seconds is h = h0 + Ztgt2/2, where g is gravity.

Public test cases
  • Input

    7
    6 1 10
    6 2 10
    10 1 6
    10 2 6
    6 1 6
    8 1 8
    10 1 10
    
    

    Output

    1
    0
    1
    1
    0
    1
    0
    
  • Information
    Author
    Anders Jonsson
    Language
    English
    Official solutions
    Unknown. This problem is being checked.
    User solutions
    C++