1377:Cylinder

时间限制:2 S   /  内存限制:65536 KB
AC:14   /  Submit:41
问题描述

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

提示说明

(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年第八届福建省大学生程序设计竞赛热身赛

Copyright 2016 - 2024 XUJC ACM Team
闽ICP备2020022076号-1