QOJ.ac

QOJ

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

#3447. 奶牛起重机

الإحصائيات

Farmer Laura 有一个谷仓。在她的谷仓里有两头牛,Monica 和 Lydia。Monica 和 Lydia 很喜欢吃东西,而且非常懒。一天中大部分时间它们都在谷仓里休息,等着 Laura 给它们送上美味的餐点。Farmer Laura 对喂食时间非常讲究,所以 Monica 和 Lydia 非常清楚每天在同一时间准时进食。

这听起来可能让你感到惊讶,但确实出了点问题。Farmer Laura 需要你的帮助。她要更换谷仓地板上的一些木板,这意味着必须暂时将牛从它们最喜欢的地方移走。由于牛懒得不可思议,它们拒绝自己走动。Farmer Laura 租用了一个极好的工具来解决这个问题——一台专门为牛的舒适度而设计和制造的“牛吊车”。

Photo by Stuart Heath

我们将谷仓想象成一条一维直线。牛吊车在时间 $t = 0$ 时从位置 $x = 0$ 出发,每秒可以移动一个单位距离。吊车一次只能运送一头牛,但它可以根据需要多次装载和卸载牛。Monica 当前的位置在 $x = m$,Lydia 的位置在 $x = l$。Monica 将被移至临时位置 $x = M$,Lydia 将被移至临时位置 $x = L$。Monica 和 Lydia 每天进食的时间分别是 $t_m$ 和 $t_l$ 秒,所以牛最好在这些时间点准时到达各自的临时位置。你可以假设吊车装载或卸载牛不需要时间,并且两头牛可以在同一时间处于同一位置。

任务

Farmer Laura 想知道她是否能移动这些牛,使得它们都能在各自的进食时间之前到达临时位置。

输入格式

输入包含三行。第一行包含两个整数 $m$ 和 $l$,表示牛的当前位置。第二行包含两个整数 $M$ 和 $L$,表示牛的新位置。第三行包含两个整数 $t_m$ 和 $t_l$,表示两头牛进食的时间。保证 $-10^8 \le m, l, M, L \le 10^8$ 且 $1 \le t_m, t_l \le 10^8$。同时保证两头牛都会移动,即 $m \neq M$ 且 $l \neq L$。

输出格式

输出应为一个单词。如果可以在两头牛进食前将它们移到指定位置,则输出 “possible”。否则,输出 “impossible”。

样例

输入格式 1

-1 1
-2 2
6 6

输出格式 1

possible

输入格式 2

-1 1
-2 2
5 5

输出格式 2

impossible

输入格式 3

-1 1
1 -1
3 5

输出格式 3

possible

输入格式 4

0 1
2 3
6 3

输出格式 4

possible

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.