QOJ.ac

QOJ

Time Limit: 15 s Memory Limit: 256 MB Total points: 100

#13059. 球队

Statistics

在设计游戏时,平衡技巧与随机性非常重要。如果高水平玩家总是战胜低水平玩家,游戏会变得令人沮丧;反之,如果结果完全随机,那么获胜也就没有成就感了。

在这一新设计的游戏中,每位玩家的技巧可以用一个 1 到 2 之间的浮点数来描述,其中 1 代表完全的新手,2 代表顶尖高手。技巧为 $s_1$ 的玩家战胜技巧为 $s_2$ 的玩家的概率为 $\frac{s_1}{s_1+s_2}$(游戏中没有平局)。

你的队伍由 $n$ 名玩家组成,技巧分别为 $a_1, a_2, \dots, a_n$。对方队伍由 $m$ 名玩家组成,技巧分别为 $b_1, b_2, \dots, b_m$。你队伍中的每位成员将与对方队伍中的每位成员进行一场比赛,总共进行 $n \times m$ 场比赛。请问你队伍中的每位玩家预期获胜的场数是多少?

输入格式

输入文件的第一行包含两个整数 $n$ 和 $m$,$1 \le n, m \le 10^6$。第二行包含 $n$ 个用空格分隔的浮点数,数值在 1 到 2 之间,小数点后最多 8 位,表示你队伍中玩家的技巧。第三行以相同格式包含对方队伍的 $m$ 个技巧。

输出格式

输出 $n$ 个用空格分隔的数字:你队伍中每位玩家预期获胜的场数。

如果每个数字与正确答案的绝对误差或相对误差在 $10^{-8}$ 以内,则你的输出将被视为正确。

样例

样例输入 1

3 2
1.0 2.0 1.5
1.0 2.0

样例输出 1

0.833333333333333 1.166666666666666 1.028571428571428

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.