1645.
Gear Up
时间限制 4000 ms
内存限制 128 MB
constroy has some gears, each with a radius. Two gears are considered adjacent if they meet one of the following conditions:
1. They share a common edge (i.e. they have equal linear velocity).
2. They share a common shaft (i.e. they have equal angular velocity).
It is guaranteed that no pair of gears meets both of the above conditions.
A series of continuous adjacent gears constitutes a gear path. There is at most one gear path between each two gears.
Now constroy assigns an angular velocity to one of these gears and then asks you to determine the largest angular velocity among them.
sd0061 thinks this problem is too easy, so he replaces some gears and then asks you the question again.
输入数据
输出数据
For each test case, firstly output "Case #$x$:" in one line (without quotes), where $x$ indicates the case number starting from $1$, and then for each operation of $a = 2$, output in one line a real number, the natural logarithm of the maximum angular velocity, with the precision of $3$ digits.
样例输入
复制
4 3 4
1 4 16 2
1 2 4
1 2 3
2 1 4
1 1 16
1 2 4
2 4 4
1 4 16
4 3 5
2 16 4 8
2 1 2
1 2 3
1 1 4
2 1 4
1 3 8
2 1 16
1 4 1
2 1 8
· · \n
· · · \n
· · \n
· · \n
· · \n
· · \n
· · \n
· · \n
· · \n
· · \n
· · · \n
· · \n
· · \n
· · \n
· · \n
· · \n
· · \n
· · \n
· · \n
样例输出
复制
Case #1:
1.386
Case #2:
2.773
3.466
2.773
· \n
\n
· \n
\n
\n
\n