Problem L. Pinball

时间限制 1000 ms   内存限制 256 MB

There is a slope on the 2D plane. The lowest point of the slope is at the origin. There is a small ball falling down above the slope. Your task is to find how many times the ball has been bounced on the slope.

It's guarantee that the ball will not reach the slope or ground or Y-axis with a distance of less than 1 from the origin. And the ball is elastic collision without energy loss. Gravity acceleration $g = 9.8 m/s^2$.
 

输入数据

There are multiple test cases. The first line of input contains an integer T (1 $\le$ T $\le$ 100), indicating the number of test cases.

The first line of each test case contains four integers a, b, x, y (1 $\le$ a, b, -x, y $\le$ 100), indicate that the slope will pass through the point(-a, b), the initial position of the ball is (x, y).
 

输出数据

Output the answer.

It's guarantee that the answer will not exceed 50.
 

样例输入

复制
1
5 1 -5 3

样例输出

提交

请先 登录

© 2025 FAQs Contact About