8589: A Stack of CDs

内存限制:256 MB 时间限制:1 S
题面:传统 评测方式:文本比较 上传者:
提交:5 通过:0

题目描述

One day, NIO wants to find a CD from a whole bunch of CDs. However, there are too many CDs stacking on the floor so NIO is hard to pick out the one he needs. Looking at the stack of CDs from top to bottom, he is curious about from his vision, what is the length of the edges of the CDs he can see. Assum that every CD is a simple circle and NIO know the order of circles from bottom to top.

输入格式

For each test case, the first line is n (1≤n≤1000), representing the number of CDs. Then n lines follow, each of which contains three integers, xi,yi,ri (1≤xi,yi,ri≤104), denoting the i-th CD's center and its radius from bottom to top.

输出格式

Output a number representing the length of edges NIO can see.
Your answer is acceptable if its absolute or relative error does not exceed 10−6.

输入样例 复制

3
45 45 50
20 45 10
52 52 50

输出样例 复制

481.154633857