"Noioj" p7939

Source: Internet
Author: User

09: The Swollen stick
    • View
    • Submit
    • Statistics
    • Questions
Total time limit:
1000ms
Memory Limit:
65536kB
Describe

When the temperature of a fine stick of length l is increased by n degrees, it expands to the new length l ' = (1+n*c) *l, where C is the coefficient of thermal expansion.

When a thin stick is heated between two walls, it expands to form an arc of the bow, and the bow chord is the original position of the stick before it is heated.

Your task is to calculate the offset distance from the center of the stick.

Input
three nonnegative real numbers: The initial length of the stick (in millimeters), the temperature change (unit: degree), and the coefficient of thermal expansion of the material.
Ensure that the stick does not swell to 1.5 times times the original length.
Output
the offset distance (in millimeters) of the center of the stick, reserved to the third digit after the decimal point.
Sample input
1000 100 0.0001
1#include <iostream>2#include <cstdio>3#include <cmath>4 #definepi=3.141592635897935 using namespacestd;6 intMain ()7 {8     DoubleL,n,c,ll,left,mid,right;9scanf"%LF%LF%LF",&l,&n,&c);TenLl= (1+N*C) *l; Oneleft=0; ARight=asin (1.0); -      while(right-left>1e- -) -     { theMid= (Right+left)/2; -         if(Ll*sin (mid)/mid<=l) -right=mid; -         Else +left=mid; -     } +printf"%.3LF", l/2*tan (left/2)); A     return 0; at}

Online find the formula, because do not know that C + + sin is a radian calculation, and not radian system.

"Noioj" p7939

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.