HNUOJ_10046

本文详细介绍了自适应Simpson积分法,包括原理、公式推导及C语言实现。通过将积分区间不断细分,利用二次曲线逼近原函数,确保在设定精度下求得准确的积分结果。同时,强调了积分函数连续性和预处理图形的重要性。
摘要由CSDN通过智能技术生成

Bridge
Time Limit: 1000ms, Special Time Limit:2500ms,Memory Limit:32768KB
Total submit users: 153, Accepted users:110
Problem 10046 : No special judgement
Problem description

A suspension bridge suspends the roadway from huge main cables, which extend from one end of the bridge to the other. These cables rest on top of high towers and are secured at each end by anchorages. The towers enable the main cables to be draped over long distances.

Suppose that the maximum distance between two neighboring towers is D, and that the distance from the top of a tower to the roadway is H. Also suppose that the shape of a cable between any two neighboring towers is the same symmetric parabola (as shown in the figure). Now given B, the length of the bridge and L, the total length of the cables, you are asked to calculate the distance between the roadway and the lowest point of the cable, with minimum number of towers built (Assume that there are always two towers built at the two ends of a bridge).

Input

Standard input will contain multiple test cases. The first line of the input is a single integer T (1 <= T <= 10) which is the number of test cases. T test cases follow, each preceded by a single blank line.

For each test case, 4 positive integers are given on a single line.
D - the maximum distance between two neighboring towers;
H - the distance from the top of a tower to the roadway;
B - the length of the bridge; and
L - the total length of the cables.

It is guaranteed that B <= L. The cable will always be above the roadway.

Output

Results should be directed to standard output. Start each case with "Case #:" on a single line, where # is the case number starting from 1. Two consecutive cases should be separated by a single blank line.

For each test case, print the distance between the roadway and the lowest point of the cable, as is described in the problem. The value must be accurate up to two decimal places.

Sample Input
2
20 101 400 4042
1 2 3 4
Sample Output
Case 1:
1.00

Case 2:
1.60
Judge Tips


方法一:

桥的间隔数为n = ceil(B/D),每段绳子的长度为L / n,相邻两塔之间的距离为 B / n

主要问题还是在于已知抛物线的开口宽度w 和 抛物线的高度h 求抛物线的长度

弧长积分公式为:

设抛物线方程为f(x) = ax2,则这段抛物线弧长为

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值