QOJ.ac

QOJ

حد الوقت: 1 s حد الذاكرة: 256 MB مجموع النقاط: 100

#7823. 两次投掷

الإحصائيات

骰子的六个面上分别标有 6 个不同的数字。将骰子投掷两次,每次投掷后,计算四个侧面上的数字之和。已知这些和以及骰子上的数字集合,请确定哪些数字可能位于与标有数字 $A_1$ 的面相对的面上。

输入格式

第一行包含六个不同的正整数 $A_1, \dots, A_6$,用空格分隔,表示骰子面上的数字,且每个数字不超过 $10\,000$。

第二行包含两个正整数,用空格分隔,表示两次投掷后四个侧面数字之和。每项和均不超过 $40\,000$。

输出格式

在唯一的一行中,按升序输出所有可能位于与标有数字 $A_1$ 的面相对的面上的数字,并用空格分隔。如果没有这样的数字,则输出 $-1$。

样例

样例输入 1

2 3 4 5 6 1
13 15

样例输出 1

4 6

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.