問題一覧 > 通常問題

No.2525 Great Move

レベル : / AI推定難易度 : 500 / 実行時間制限 : 1ケース 2.000秒 / メモリ制限 : 512 MB / 標準ジャッジ問題
タグ : (AC するまで非表示) / 解いたユーザー数 223
作問者 : hirayuu_yc / テスター : Basin-Bug
お気に入りにしたユーザー ProblemId : 9715 / 自分の提出
問題文最終更新日: 2023-11-03 07:38:17
This statement was translated by AI (claude-opus-5-5, effort medium) and may contain errors or differ in nuance from the original. The original statement takes precedence. Back to the original
yukicoder contest 411 オムニバスコンテスト (順位表) の他の問題:

Problem Statement

Halc and Sapp are on a number line of infinite length. Initially, both of them are at position $0$.

Halc and Sapp repeat the following action any number of times. (Zero times is also allowed.)

  • Swap the positions of Halc and Sapp, and then each of them moves exactly $1$ to the left or right. Neither of them is allowed to stay without moving left or right.

Determine whether it is possible that Halc ends up at position $H$ and Sapp ends up at position $S$. Print Possible if it is possible, and Impossible otherwise.

Input

$H$ $S$
  • $-10^{2×10^5}\leqq H,S\leqq 10^{2×10^5}$
  • All inputs are integers.

Output

Print Possible if it is possible, and Impossible otherwise.

Sample

Sample 1
Input
-1 1
Output
Possible

Initially, both of them are at position $0$, so they both remain at $0$ even after swapping positions. After that, this can be achieved by Halc moving to $-1$ and Sapp moving to $1$.

Sample 2
Input
0 1
Output
Impossible
Sample 3
Input
998244353 1000000007
Output
Possible

提出するには、Twitter 、GitHub、 Googleもしくは右上の雲マークをクリックしてアカウントを作成してください。