QOJ.ac

QOJ

시간 제한: 2.0 s 메모리 제한: 2048 MB 총점: 100

#16036. 骰子游戏

통계

Photo by JD Hancock

Gunnar 和 Emma 在家玩了很多棋盘游戏,所以他们拥有许多不是普通 6 面的骰子。例如,他们有一个 10 面的骰子,上面的数字是 $47, 48, \dots, 56$。

斯德哥尔摩发生了一场大风暴,所以 Gunnar 和 Emma 被困在家里,停电了几个小时。他们已经玩完了所有现有的游戏,所以他们想出了一个新游戏。每个玩家有 2 个骰子并进行投掷。点数之和较大的玩家获胜。如果两个和相同,则游戏以平局结束。

任务

给定 Gunnar 和 Emma 的骰子描述,哪个玩家获胜的概率更高?

他们所有的骰子都具有以下属性:每个骰子包含数字 $a, a + 1, \dots, b$,其中 $a$ 和 $b$ 分别是骰子上的最小和最大数字。每个数字恰好出现一次,因此该骰子有 $b - a + 1$ 个面。

输入格式

第一行包含四个整数 $a_1, b_1, a_2, b_2$,描述 Gunnar 的骰子。第 $i$ 个骰子包含面上的数字 $a_i, a_i + 1, \dots, b_i$。你可以假设 $1 \le a_i \le b_i \le 100$。你还可以假设每个骰子至少有四个面,即 $a_i + 3 \le b_i$。

第二行包含相同格式的 Emma 的骰子描述。

输出格式

输出获胜概率较高的玩家名字(GunnarEmma)。如果两个玩家获胜的概率相同,则输出 Tie

样例

输入样例 1

1 4 1 4
1 6 1 6

输出样例 1

Emma

输入样例 2

1 8 1 8
1 10 2 5

输出样例 2

Tie

输入样例 3

2 5 2 7
1 5 2 5

输出样例 3

Gunnar

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.