1629 B's cone

Source: Internet
Author: User
B will use a cone with a surface area of S to pack the Baishan cloud. B wants to maximize the size of the Baishan cloud. B wants to know the maximum size. Note that the surface area of the cone includes the bottom and side. Input
An integer in a row, indicating the surface area S. (1 <= S <= 10 ^ 9)
Output
A row has a real number, indicating the volume.
Input example
8
Output example
1.504506

 

Code:

 1 #include <cstdio> 2 #include <cmath> 3 #include <cstring> 4 #include <string> 5 #include <algorithm> 6 #include <queue> 7 #include <stack> 8 #include <map> 9 #include <set>10 #include <vector>11 #include <iostream>12 using namespace std;13 #define for0(i, n) for(int i=0; i<(n); ++i)14 #define for1(i,a,n) for(int i=(a);i<=(n);++i)15 #define for2(i,a,n) for(int i=(a);i<(n);++i)16 #define for3(i,a,n) for(int i=(a);i>=(n);--i)17 #define for4(i,a,n) for(int i=(a);i>(n);--i)18 #define CC(i,a) memset(i,a,sizeof(i))19 #define LL long long20 #define MOD 100000000721 #define INF 0x3f3f3f3f22 #define MAX 5010023 #define PI 3.141592624 25 int main()26 {27     double s;28     scanf("%lf",&s);29     printf("%lf\n",s*sqrt(s *PI *2)/(PI*12));30     return 0;31 }

 

1629 B's cone

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.