#T590. 球弹跳高度的计算
球弹跳高度的计算
Description
A ball falls from a certain height h (in meters). After each landing, it bounces back to half of its previous height and then falls again. Write a program to calculate the total distance traveled by the ball when it hits the ground for the 10th time, and the height of the 10th bounce.
The output consists of two lines:
- Line 1: The total distance traveled by the ball when it hits the ground for the 10th time.
- Line 2: The height of the 10th bounce.
Input Format
An integer h representing the initial height of the ball.
Output Format
- Line 1: The total distance traveled by the ball when it hits the ground for the 10th time.
- Line 2: The height of the 10th bounce.
Note: The result may be a real number, so use the double type to store it.
Hint: No special precision control is needed for the output. You can use cout << ANSWER or printf("%g", ANSWER).
20
59.9219
0.0195312