CodeForces - 630Q
Description IT City administration has no rest because of the fame of the Pyramids in Egypt. There is a project of construction of pyramid complex near the city in the place called Emerald Walley. The distinction of the complex is that its pyramids will be not only quadrangular as in Egypt but also triangular and pentagonal. Of course the amount of the city budget funds for the construction depends on the pyramids' volume. Your task is to calculate the volume of the pilot project consisting of three pyramids — one triangular, one quadrangular and one pentagonal. The first pyramid has equilateral triangle as its base, and all 6 edges of the pyramid have equal length. The second pyramid has a square as its base and all 8 edges of the pyramid have equal length. The third pyramid has a regular pentagon as its base and all 10 edges of the pyramid have equal length. Input The only line of the input contains three integers l3, l4, l5 (1 ≤ l3, l4, l5 ≤ 1000) — the edge lengths of triangular, quadrangular and pentagonal pyramids correspondingly. Output Output one number — the total volume of the pyramids. Absolute or relative error should not be greater than10 - 9. Sample Input
Input
2 5 3
Output
38.546168065709 Source
//题意:
给你正三棱锥,正四棱锥,正五棱锥的边长l3,l4,l5,问它们的体积和为多少。
//正三棱锥,正四棱锥的体积都很好算,但正五棱锥的体积算了一晚上还是错的,看了大神的博客才稍微懂点。。。
计算几何,重点在求高
正四面体 高 正五面体 高 正六面体 高 体积
//下面的更简洁,用数学公式。
|
CodeForces - 630Q Pyramids (数学几何&公式)
最新推荐文章于 2020-03-18 16:04:51 发布