Mary is a skilled billiards player who is looking to improve her trick-shots. She
has modified her own billiards table by removing 3 of the walls and leaving only
the back bumper remaining, such that balls will roll off of 3 table edges onto
the floor but elastically bounce off of the back bumper. She then places the
black 8-ball with mass m_8 and radius r = 2.8 cm at rest at a distance of x_8
from the back bumper (measured from the center of the 8-ball), then she places
the white cue-ball has mass m_cue and radius r = 2.8 cm at a distance of x_cue
from the back bumper (measured from the center of the cue-ball), so
that the line formed between centers of the two balls is perpendicular to the
back bumper.
She then strikes the cue ball so that at time t=0 it has a velocity v_cue
aimed directly at the center of the 8-ball. Assuming that her aim was perfect,
how many total collisions will the 8-ball experience with both the back bumper and
with the cue ball?
Make the following assumptions so that this is modeling an ideal case:
r = 2.8 cm.All values of mass are in units of grams, lengths in units of centimeters,
and velocities in units of meters per second.
Also note that much of the information given in each testcase is not strictly necessary to calculate
the exact solution.
Input Data
First line will be Q, the quantity of testcases.
Q lines will then follow, each in the format m_8 m_cue x_8 x_cue v_cue.
Answer
Should consist of Q space-separated integers, corresponding to the total
collisions that the 8-ball makes with both the cue-ball and the back bumper.
Example
input data:
4
1 1 10 20 1
2 4 20 40 5
9 3 30 60 10
1 100 40 80 15
answer:
3 5 2 31