51nod1269 B-June's cone

Source: Internet
Author: User

1629 B-June's cone reference time limit: 1 seconds space limit: 131072 KB Score: 10 Difficulty: 2-level algorithm topic collection concern B June to use a cone surface area for s will be wrapped up in Baishan cloud. B June Hope to pack the white cloud volume as large as possible, b June want to know the maximum volume can be how much. Note the surface area of the cone includes the underside and sides. Input
An integer line representing the surface area S. (1 <= S <= 10^9)
Output
A real number on a line representing the volume.
Input example
8
Output example
1.504506
Wwwwodddd(topic Provider)the first idea to get this problem is to write the area volume relationship and then find the relationship. The great God said that the standard practice of this problem is to use a three-way ~ can be used as slag residue I will not----later to learn to fill up. but the group of Giants gave another idea of mathematical modelling:To achieve an area/volume best ratio, the model style is consistent ~ scales proportionally to twice times as an example: r=r*2 S=s bottom +s side =2^2*s bottom +2^2*s bottom =2^2s    v=1/3*s Bottom *h=1/3*2^2s *2*h=2^3v It 's amazing that I've learned a trick of slag residue .
#include <stdio.h> #include <algorithm> #include <iostream>using namespace std;double pow (double n) {    return sqrt (n*n*n);} int main () {    int s;    while (~SCANF ("%d", &s)) {        double V;        v = (double) 1.504506*pow (s/8.0);        printf ("%lf\n", v);    }}

  

51nod1269 B-June'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.