#BS0000381. Đường chạy điền kinh (Athletics Track)
Bài tập thuộc lộ trình
Mục lục đề ⌄
Đường chạy điền kinh (Athletics Track)
Athletics Track
Source: UVa
Version: Phuoc Hung OJ Extended
Problem Statement
A stadium for the London Olympics needs a running track with perimeter exactly 400 metres. Its rectangular turf has length and width . The boundary consists of the two lengthwise sides and two circular arcs bulging outward from the widthwise sides. Both arcs belong to the same circle passing through the rectangle’s four vertices.
Given the ratio , determine and .

Input
One line contains two integers in the format a : b, separated by a colon.
Output
Print two real numbers in that order, separated by whitespace. The absolute error of each value must not exceed .
Subtasks
- Subtask 1 (20 points): ; .
- Subtask 2 (30 points): ; .
- Subtask 3 (50 points): .
Examples
Input
3 : 2
Output
117.1858168913 78.1238779275
Explanation
The sides have ratio . At dimensions 3 and 2, the radius is and each arc subtends . Scaling the entire figure to perimeter 400 gives a factor of about . The two sides are 3 and 2 times this factor.
Input
5 : 4
Output
107.2909560477 85.8327648381
Explanation
For a reference rectangle with sides 5 and 4, the circle radius is and each arc subtends . The perimeter is . Scaling both sides by 400 divided by this perimeter gives and metres.