QOJ.ac

QOJ

実行時間制限: 3.0 s メモリ制限: 256 MB 満点: 100

#6093. 伤害评估

統計

一辆通过铁路运输汽油的罐车,其形状为一个圆柱体,两侧各有一个球冠。圆柱体的直径为 $d$,长度为 $l$。球冠的半径为 $r$ ($2r \ge d$)。铁路发生事故,罐车脱轨。它现在躺在地面上,部分储存的汽油已经流出。必须进行损失评估。罐车在地面上的位置是通过测量其倾斜度来确定的,即圆柱体左右两侧底部点之间的高度差 $t$ ($0 \le t \le l$)。罐内汽油的液位是通过测量圆柱体底部最低点与汽油顶面之间的高度差 $h$ 来确定的。在本题中,汽油的顶面总是与罐体的圆柱部分相交 ($0 \le h \le t + d\sqrt{1 - (t/l)^2}$)。

你的任务是计算罐中还剩下多少汽油。

罐体示意图与罐体位置及汽油液位

输入格式

输入文件包含一行,由五个整数 $d, l, r, t$ 和 $h$ 组成,分别代表罐体圆柱部分的直径和长度、球冠的半径、倾斜度以及汽油液位测量值。所有数值均以毫米为单位 ($1 \text{ 毫米} = 10^{-3} \text{ 米}$),它们满足题目描述中的所有约束条件,且 $d, l \ge 100, d, l, r \le 10\,000$。

输出格式

向输出文件写入一个实数,即罐中汽油的体积,单位为升 ($1 \text{ 升} = 10^{-3} \text{ 立方米}$)。答案的绝对误差不得超过 $0.1$ 升。

样例

样例输入 1

3000 6000 1600 0 3000

样例输出 1

50974.56

样例输入 2

3000 6000 1600 3441 4228

样例输出 2

40728.90

Discussions

About Discussions

The discussion section is only for posting: General Discussions (problem-solving strategies, alternative approaches), and Off-topic conversations.

This is NOT for reporting issues! If you want to report bugs or errors, please use the Issues section below.

Open Discussions 0
No discussions in this category.

Issues

About Issues

If you find any issues with the problem (statement, scoring, time/memory limits, test cases, etc.), you may submit an issue here. A problem moderator will review your issue.

Guidelines:

  1. This is not a place to publish discussions, editorials, or requests to debug your code. Issues are only visible to you and problem moderators.
  2. Do not submit duplicated issues.
  3. Issues must be filed in English or Chinese only.
Active Issues 0
No issues in this category.
Closed/Resolved Issues 0
No issues in this category.