UVA-10499 the Land of Justice

Source: Internet
Author: User

Click to open link

This problem means one by one solid ball, and then it is divided into n parts along the axis, asked later surface area than the original increase of a few percent.

The initial surface area of 4XPIXRXR was divided into 2 parts, the surface area increased 2xpi*r*r, so is 50%, divided into three parts of the surface area increased 3xpixr*r. So it's 75%,n to increase the 25xn%.

Use double to prevent overflow.

#include <cstdio>
int main ()
{
    double n;
    while (~SCANF ("%lf", &n) &&n>0)
    {
        if (n==1) printf ("0%%\n");
        else printf ("%.0lf%%\n", 25*n);
    }
    return 0;
}


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.