402656: GYM100834 E Polycarp and Arcolygon

Memory Limit:512 MB Time Limit:2 S
Judge Style:Text Compare Creator:
Submit:0 Solved:0

Description

E. Polycarp and Arcolygontime limit per test2 secondsmemory limit per test512 megabytesinputstandard inputoutputstandard output

Polycarp has got a plane with N circles on it and an infinitely long thread. Each circle i is discribed using the centerpoint coordinates xi and yi and the radius ri. Polycarp uses the thread to swift all the circles so that all of them are inside the figure, formed by the thread. However, the thread can not be cut.

Polycarp is eager to know what the shortest length the tread should be to be able to swift the circles and what area the resulting figure will have.

Input

The first line contains the only integer N, 2 ≤ N ≤ 100.

Next N lines contain integer triplet xi, yi, ri. The numbers are separated by whitespaces,  - 1000 ≤ xi, yi ≤ 1000, 1 ≤ ri ≤ 100. It is insured that the circles do not intersect and contact with each other.

Output

Output two numbers — thread length and figure area. You may assume that answers is coparated with the precision of 10 - 6.

ExamplesInput
2
0 0 1
99 99 100
Output
670.80969437 33561.73030009
Input
2
10 0 4
-10 0 4
Output
65.13274123 210.26548246
Input
5
0 100 10
-100 -20 10
100 -20 10
-50 40 10
50 40 10
Output
575.24184011 17438.25913572

加入题单

上一题 下一题 算法标签: