QOJ.ac

QOJ

Límite de tiempo: 1.0 s Límite de memoria: 256 MB Puntuación total: 100

#11609. 机场值机

Estadísticas

Pusheen 终于决定来到日本见她的朋友们。Pusheen 到达机场,需要办理登机手续。此时,有 $n$ 个值机柜台正在工作,每个柜台前都有大量的乘客排队。每个柜台已经工作了一段时间,不清楚它从什么时候开始处理当前乘客。已知每个柜台处理一名乘客需要固定的时间,但不同柜台所需的时间可能不同。已知每个柜台的这个固定时间是一个实数,服从 $[l, r]$ 上的均匀分布。

让我们增加一点形式化描述。对于每个柜台,首先我们选择一个值 $t$:即它处理每名乘客所需的时间,这是一个服从 $[l, r]$ 上均匀分布的随机实数。之后,我们选择该柜台完成当前乘客(即在 Pusheen 到达之前就开始办理手续的乘客)处理所需的时间:这是一个服从 $[0, t]$ 上均匀分布的随机实数。不同柜台的选择是相互独立的。

Pusheen 希望尽快办理登机手续,因此她想选择一个比其他柜台工作更快的柜台(及其队列)。为了实现这一目标,Pusheen 选择的是第一个完成当前乘客值机手续的柜台。

请问 Pusheen 以这种方式选中最快柜台的概率是多少?

输入格式

第一行包含一个整数 $t$,表示测试用例的数量 ($1 \le t \le 100$)。

接下来的 $t$ 行,每行描述一个测试用例,包含三个整数 $n$、$l$ 和 $r$:表示柜台数量以及工作时间的范围 ($2 \le n \le 4$; $1 \le l < r \le 50$)。

输出格式

对于每个测试用例,在单独的一行中输出所需的概率。

你的答案必须精确到绝对误差或相对误差不超过 $10^{-7}$。形式化地说,令你的答案为 $a$,标准答案为 $b$,如果满足 $\frac{|a-b|}{\max(1, |b|)} \le 10^{-7}$,则你的答案被视为正确。

样例

输入 1

2
3 4 5
2 1 10

输出 1

0.362041935348
0.708657932673

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.