#P5413. [YNOI2019] 骑单车
[YNOI2019] 骑单车
Description
Xiaoming needs to ride a bicycle through road segments every morning to get to class. The length of the -th segment is , and the speed limit is (the riding speed on the road cannot exceed the speed limit). The maximum absolute value of acceleration is (he can either speed up or slow down). The initial speed is . Your task is to compute the minimum time for Xiaoming to pass these segments.
Input Format
This problem contains multiple test cases.
The first line contains a positive integer , representing the number of test cases.
Then follow test cases, each in the following format:
Each test case contains lines.
The first line contains a positive integer , representing that there are road segments.
The next lines each contain three positive integers , representing the length, the speed limit, and the maximum absolute acceleration of the -th segment, respectively.
Output Format
Output lines, corresponding to the answers for the test cases. That is, the minimum time Xiaoming needs to pass the road segments (your answer is accepted as long as the absolute error from the standard answer is within ).
1
2
5 3 1
1 1 1
4.6904157598
Hint
For of the testdata: .
For of the testdata: .
For of the testdata: .
Translated by ChatGPT 5
京公网安备 11011102002149号