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);
}
}

最新文章

  1. VC++6.0文件关联问题的解决方法
  2. 在IIS下部署Thinkphp项目,验证码不能显示的解决办法
  3. 动画黄金搭档:CADisplayLink &amp; CAShapeLayer
  4. zabbix3.x搭建(1)
  5. VMWare安装Solaris虚拟机的网络设置
  6. OpenGIS Simple feature access
  7. pg_dump 备份与恢复的简单操作
  8. dzzoffice注册开启
  9. VSS 之 未知的用户名或密码错误
  10. 在Vim里使用gtags-cscope
  11. Windows下Android SDK Manage下载速度缓慢的解决方法
  12. javaweb分页思想
  13. c++,给常成员变量赋值
  14. Swift - 使用UIWebView和UIToolbar制作一个浏览器
  15. 从A页面跳转到B页面,从B页面按浏览器自带按钮返回到A页面并且刷新页面--手机操作浏览器自带返回并自带刷新
  16. HTML5学习笔记四:html5结构
  17. hive、impala集成ldap
  18. 利用QuickCHM制作chm
  19. js知识点总结
  20. Apache JMeter压力测试实例

热门文章

  1. mybaits 连接数据库汉字保存乱码??
  2. the little schemer 笔记(10.1)
  3. One hundred layer HDU - 4374
  4. JSP文件过大无法编译
  5. Excel数据直接到DataTable---&gt;DB
  6. JAVA 运用流编程实现简单的&quot;记事本&quot;功能
  7. AJPFX总结Java 程序初始化过程
  8. 教你如何配置WampServer
  9. Linux上用mvn安装node.js
  10. webapi参数处理get过个参数