碗AI (CI翻译)
Once Petya was in such a good mood that he decided to help his mum with the washing-up. There were $*n*$ dirty bowls in the sink. From the geometrical point of view each bowl looks like a blunted cone. We can disregard the width of the walls and bottom. Petya puts the clean bowls one on another naturally, i. e. so that their vertical axes coincide (see the picture). You will be given the order in which Petya washes the bowls. Determine the height of the construction, i.e. the distance from the bottom of the lowest bowl to the top of the highest one.
一天,Petya 心情非常好,于是决定帮妈妈洗碗。水槽里有 $*n*$ 个脏碗。从几何学角度看,每个碗都像一个被截去尖端的圆锥。我们可以忽略碗壁和碗底的厚度。Petya 自然地将洗干净的碗一个套在另一个上面,即使它们的竖直轴重合(见图)。现在给出 Petya 洗碗的顺序。请确定这些碗叠起来后的高度,也就是最低碗的底部到最高碗顶部之间的距离。AI (CI翻译)

AI (CI翻译)
Input
输入格式
AI (CI翻译)The first input line contains integer $*n*$ ($1 ≤ *n* ≤ 3000$). Each of the following $*n*$ lines contains 3 integers $*h*$, $*r*$ and $*R*$ ($1 ≤ *h* ≤ 10000, 1 ≤ *r* < *R* ≤ 10000$). They are the height of a bowl, the radius of its bottom and the radius of its top. The plates are given in the order Petya puts them on the table.
第一行包含一个整数 $*n*$($1 ≤ *n* ≤ 3000$)。接下来的 $*n*$ 行中,每行包含 3 个整数 $*h*$、$*r*$ 和 $*R*$($1 ≤ *h* ≤ 10000, 1 ≤ *r* < *R* ≤ 10000$)。它们分别表示一个碗的高度、底部半径和顶部半径。碗按照 Petya 将它们放到桌子上的顺序给出。AI (CI翻译)
Output
输出格式
AI (CI翻译)Output the height of the plate pile accurate to at least $10^{ - 6}$.
输出碗堆的高度,绝对误差或相对误差不超过 $10^{ - 6}$。AI (CI翻译)
样例
2
40 10 50
60 20 30
70.00000000
3
50 30 80
35 25 70
40 10 90
55.00000000
题面与样例版权归 Codeforces 及出题人所有;中文翻译由 AI 生成(gpt-6.1-sol),如有出入请以原文为准。