B君要用一个表面积为S的圆锥将白山云包起来。
B君希望包住的白山云体积尽量大,B君想知道体积最大可以是多少。
注意圆锥的表面积包括底面和侧面。
Input
一行一个整数,表示表面积S。(1 <= S <= 10^9)
Output
一行一个实数,表示体积。
Input示例
8
Output示例
1.504506
思路: 将圆锥表面积公式和体积公式结合可得出
AC代码:
#include<bits/stdc++.h>
using namespace std;
const double pi =3.1415926535;
int main()
{
#ifdef LOCAL
freopen("in.txt","r",stdin);
#endif // LOCAL
// ios_base::sync_with_stdio(false);
// cin.tie(NULL),cout.tie(NULL);
double s;
scanf("%lf",&s);
double x = s/(4*pi);
double ans = sqrt((s*s*x-2*pi*s*x*x)/9);
printf("%f\n",ans);
return 0;
}