Description

When a thin rod of length L is heated n degrees, it expands to a new length L' = (1+n*C)*L, where C is the coefficient of heat expansion.

When a thin rod is mounted on two solid walls and then heated, it expands and takes the shape of a circular segment, the original rod being the chord of the segment.

Your task is to compute the distance by which the center of the rod is displaced. That means you have to calculate h as in the picture.

Input

Input starts with an integer T (≤ 20), denoting the number of test cases.

Each case contains three non-negative real numbers: the initial length of the rod in millimeters L, the temperature change in degrees n and the coefficient of heat expansion of the material C. Input data guarantee that no rod expands by more than one half of its original length. All the numbers will be between 0 and 1000 and there can be at most 5 digits after the decimal point.

Output

For each case, print the case number and the displacement of the center of the rod in single line. Errors less than 10-6 will be ignored.

Sample Input

3

1000 100 0.0001

150 10 0.00006

10 0 0.001

Sample Output

Case 1: 61.3289915

Case 2: 2.2502024857

Case 3: 0

若圆内任意弦AB、弦CD交于点P,则PA·PB=PC·PD(相交弦定理)

sinB=L/R   B=asin(L/R)   反三角函数。

 #include<cstdio>
#include<cmath>
int main()
{
int t;
scanf("%d",&t);
int num=;
while(t--)
{
double l,n,c,L,le,ri,r,mid;
scanf("%lf %lf %lf",&l,&n,&c);
L=(+n*c)*l;
le=;
ri=l/;
while(ri-le>1e-)
{
mid=(le+ri)/;
r=l*l//mid+mid/;
if(r**(asin(l//r))<L)
{
le=mid;
}
else
{
ri=mid;
}
}
printf("Case %d: ",++num);
printf("%.6f\n",le);
}
}

POJ 1905 Expanding Rods (求直杆弯曲拱起的高度)(二分法,相交弦定理)的更多相关文章

  1. poj 1905 Expanding Rods(木杆的膨胀)【数学计算+二分枚举】

                                                                                                         ...

  2. POJ 1905 Expanding Rods

                           Expanding Rods Time Limit: 1000MS   Memory Limit: 30000K Total Submissions: 1 ...

  3. POJ 1905 Expanding Rods 木棍膨胀

    描述 当长度为L的一根细木棍的温度升高n度,它会膨胀到新的长度L'=(1+n*C)*L,其中C是热膨胀系数. 当一根细木棍被嵌在两堵墙之间被加热,它将膨胀形成弓形的弧,而这个弓形的弦恰好是未加热前木棍 ...

  4. POJ 1905 Expanding Rods(二分)

    Expanding Rods Time Limit: 1000MS Memory Limit: 30000K Total Submissions: 20224 Accepted: 5412 Descr ...

  5. POJ - 1905 Expanding Rods(二分+计算几何)

    http://poj.org/problem?id=1905 题意 一根两端固定在两面墙上的杆,受热后变弯曲.求前后两个状态的杆的中点位置的距离 分析 很明显需要推推公式. 由②的限制条件来二分角度, ...

  6. POJ 1905 Expanding Rods 二分答案几何

    题目:http://poj.org/problem?id=1905 恶心死了,POJ的输出一会要lf,一会要f,而且精度1e-13才过,1e-12都不行,错了一万遍终于对了. #include < ...

  7. poj 1905 Expanding Rods (数学 计算方法 二分)

    题目链接 题意:将长度为L的棒子卡在墙壁之间.现在因为某种原因,木棒变长了,因为还在墙壁之间,所以弯成了一个弧度,现在求的是弧的最高处与木棒原先的地方的最大距离. 分析: 下面的分析是网上别人的分析: ...

  8. POJ 1905 Expanding Rods( 二分搜索 )

    题意:一个钢棍在两面墙之间,它受热会膨胀成一个圆弧形物体,这个物体长 S = ( 1 + n * C ) * L,现在给出原长 L ,温度改变量 n ,和热膨胀系数 C,求膨胀后先后中点的高度差. 思 ...

  9. poj 1905 Expanding Rods 二分

    /** 题解晚上写 **/ #include <iostream> #include <math.h> #include <algorithm> #include ...

随机推荐

  1. stylus基础教程,stylus实例教程,stylus语法总结

    stylus特点富于表现力.具有健壮性.功能丰富.动态编码不需要写CSS的冒号.分号.大括号和LESS.SASS功能类似,会这些的入手很快stylus特点安装使用stylus语法(一)选择器(二)变量 ...

  2. spark block读写流程分析

    之前分析了spark任务提交以及计算的流程,本文将分析在计算过程中数据的读写过程.我们知道:spark抽象出了RDD,在物理上RDD通常由多个Partition组成,一个partition对应一个bl ...

  3. iframe及其引出的页面跳转问题

    前提:在前一段的工作中碰到了一些页面跳转,子页面跳到父页面上的等等问题,当时页面总是跳不对,或者跳错,要不就是不需要重新打开窗口,却又重新打开一个了,特此搜寻网上各大博客论坛,加上项目经验整理一篇文章 ...

  4. 【学习笔记】Base64编码解码原理及手动实现(C#)

    1.[Base64编码原理]@叶落为重生 -base64的编码都是按字符串长度,以每3个8bit的字符为一组,-然后针对每组,首先获取每个字符的ASCII编码,-然后将ASCII编码转换成8bit的二 ...

  5. Oracle | Java日期处理

    public class Test{         public static void main (String args []){                               j ...

  6. 自欺欺人的使用 NSTimer 销毁

    自欺欺人的使用 NSTimer 销毁 Demo地址 1.NSTimer是要加到runloop中才会起作用. 常见的创建timer方式 // 第一种方式 @property (nonatomic , s ...

  7. 洛谷 U10206 Cx的治疗

    题目背景 「Cx的故事」众所周知,Cx是一个宇宙大犇.由于Cx在空中花园失足摔下,导致他那蕴含着无穷智慧的大脑受到了严重的损伤,许多的脑神经断裂.于是,Cx的wife(有么?)决定请巴比伦最好的医师治 ...

  8. 洛谷 P1006 传纸条

    题目描述 小渊和小轩是好朋友也是同班同学,他们在一起总有谈不完的话题.一次素质拓展活动中,班上同学安排做成一个m行n列的矩阵,而小渊和小轩被安排在矩阵对角线的两端,因此,他们就无法直接交谈了.幸运的是 ...

  9. SQLite -创建数据库

    SQLite -创建数据库 SQLite sqlite3命令用于创建新的SQLite数据库.你不需要有任何特权来创建一个数据库. 语法: sqlite3命令的基本语法如下: $sqlite3 Data ...

  10. Uniform Resource Identifier

    https://en.wikipedia.org/wiki/Uniform_Resource_Identifier   "URI" redirects here. For othe ...