1
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 1 year has passed since last update.

yukicoder contest 333 途中参戦記

Last updated at Posted at 2022-02-25

yukicoder contest 333 途中参戦記

A 1850 Rewrite Product

A = X - 1, B = 1 とすれば N を1減らす操作は常に行えるため、N を Y 以上の値にできれば必ず N = Y にすることができる. N が4より大きければ、半々に分ければ値を無限に大きくできる. (例えば A = 3, B = 2 として N = 5 から6に遷移し、A = 3, B = 3 として N = 9 に遷移できる). 以上を踏まえれば、Y <= X or X > 4 で判定できることが分かる.

from sys import stdin

readline = stdin.readline

T = int(readline())
for _ in range(T):
    X, Y = map(int, readline().split())
    if Y <= X or X > 4:
        print('Yes')
    else:
        print('No')
1
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?