QOJ.ac

QOJ

Points totaux : 100

#11041. 龙之饮奶者 [A]

Statistiques

Bytevillage 的居民们正处于水深火热之中。巨龙 Milkdrinker 造访了他们村庄的附近,并宣称每个月的第一天它都会来到村庄,索要 $h$ 毫升牛奶作为贡品。如果它没有得到足够的牛奶,就会将村庄烧成灰烬。

Byteman 王子对巨龙的威胁感到非常担忧。他想知道无法满足入侵者要求的概率是多少。他知道村里有 $n$ 头奶牛。他还知道每头奶牛每月的产奶量(以毫升为单位)是一个实数,在区间 $[m, M]$ 内均匀分布,且各奶牛的产奶量相互独立。

请帮助 Byteman 王子计算出现这种不幸情况的概率,即由于无法满足巨龙的需求而导致村庄被烧毁的概率。

输入格式

标准输入的第一行包含五个整数 $n$、$m$、$M$、$h$ 和 $d$($1 \le n \le 3\,000$,$0 \le m \le M \le 10^9$,$0 \le h \le 10^9$,$1 \le d \le 10\,000$)。这些数字分别表示:村里的奶牛数量、每月最小产奶量、每月最大产奶量、贡品数量以及输出所需的精度。

输出格式

标准输出的唯一一行应包含一个以小数形式表示的数字 $p$,代表无法满足巨龙需求的概率的近似值。该分数应向下取整,并保留小数点后恰好 $d$ 位。

样例

输入 1

2 4 6 11 5

输出 1

0.87500

ou importez des fichiers un par un

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.