QOJ.ac

QOJ

时间限制: 1.0 s 内存限制: 32 MB 总分: 15

#17114. VAUVAU

统计

在附近的一个村庄里,邮递员、送奶工和垃圾收集员每天早晨都会面临同一个问题:18 号房屋。18 号房屋由两只经常制造麻烦的狗看守。但他们不知道的是,这两只狗的行为是完全可以预测的。

当一天开始时,第一只狗会暴躁 $A$ 分钟,然后安静 $B$ 分钟。类似地,第二只狗会暴躁 $C$ 分钟,然后安静 $D$ 分钟。两只狗会无限重复这一行为模式,即在安静期结束后开始一个新的暴躁期,接着又是安静期,以此类推。

给定邮递员、送奶工和垃圾收集员的到达时间,请确定他们每个人分别会受到多少只狗(没有、一只或两只)的袭击。

输入格式

输入的第一行包含整数 $A$、$B$、$C$ 和 $D$。

第二行包含整数 $P$、$M$ 和 $G$,分别表示邮递员、送奶工和垃圾收集员到达 18 号房屋的时间(以一天中的第几分钟计)。例如,如果 $P$ 为 $3$,则表示“邮递员在一天中的第三分钟内的某个时间到达”。

输出格式

输出应包含三行,每行包含 'both''one''none',具体取决于我们这三位主角分别受到了多少只狗的袭击。

数据范围

输入中的所有数字均在 $1$ 到 $999$ 之间(包含 $1$ 和 $999$)。

样例

输入 1

2 2 3 3
1 3 4

输出 1

both
one
none

输入 2

2 3 4 5
4 9 5

输出 2

one
none
none

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.