题目描述
Problem Description
Aya's school has organized a spring outing to Binjiang Forest Park. Due to the long distance, their journey will include both highways and surface roads.
The school-contracted bus travels at a constant speed of \(a\) kilometers per hour on the highway, covering a total of \(b\) hours on the highway; on the surface roads, it travels at a constant speed of \(c\) kilometers per hour, covering a total of \(d\) hours on the surface roads.
Aya wants to know the answers to the following two questions:
- What is the total distance from the school to Binjiang Forest Park?
- What is the average speed of the bus during the trip?
Input Format
Input consists of one line containing four real numbers \(a, b, c, d\).
Output Format
Output two lines, each containing one real number, rounded to one decimal place.
The first line should indicate the total distance from the school to Binjiang Forest Park.
The second line should indicate the average speed of the bus during the trip.
Your answer will be considered correct if it is within 0.1 of the standard answer.
Sample Input and Output
Sample Input #1
60 2 30 1
Sample Output #1
150.0
50.0
Sample Input #2
60 1.5 30 0.5
Sample Output #2
105.0
52.5
Notes
[Sample Explanation]
For Sample #1, the bus travels at 60 kilometers per hour for 2 hours on the highway and then at 30 kilometers per hour for 1 hour on the surface roads, covering a total distance of 150 kilometers. The average speed is calculated as distance divided by time, resulting in an average speed of 50 kilometers per hour. If you output 149.9 and 50.1, it will also be considered correct.
[Data Range]
For all data, it is guaranteed that \(0 \leq a, b, c, d \leq 1000\), and \(b + d \neq 0\).
输入格式
见题面 Input 部分
输出格式
见题面 Output 部分