1077:Cylinder

时间限制: 2 S | 内存限制: 65536 KB
Accept: 0 | Submit: 0
[提交] [状态] [讨论版]
描述

Kim have n bottles. A bottle can be seen as a cylinder. One day his naughty little brother piles them up. Now he wants to know the surface area of these n bottles. In addition, he wondering what is the maximum surface area if he changes the order of the piled up bottles. (If the current surface area is already the maximum, he will not change anything.)
The surface area is defined as the area contact with air.

输入


输出

For each case, print two number a b in one line, a is the current surface area and b is the maximum possible surface area.
a and b rounded to two decimal places.

样例输入

1
3
6.0 1.0
3.0 2.0
10.0 1.5

样例输出

967.61 967.61

HINT

(6*6π)+(6*6π-3*3π)+(10*10π-3*3π)+(10*10π)+(2*6π*1)+(2*3π*2)+(2*10π*1.5)=308π=967.61
The current surface area is already the maximum


来源
2017年第八届福建省大学生程序设计竞赛热身赛