結果

問題 No.1509 Swap!!
コンテスト
ユーザー hir355
提出日時 2021-05-14 23:18:37
言語 PyPy3
(7.3.15)
結果
RE  
実行時間 -
コード長 287 bytes
コンパイル時間 288 ms
コンパイル使用メモリ 81,972 KB
実行使用メモリ 76,272 KB
最終ジャッジ日時 2024-10-02 04:52:16
合計ジャッジ時間 3,625 ms
ジャッジサーバーID
(参考情報)
judge5 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample RE * 1
other AC * 3 RE * 27
権限があれば一括ダウンロードができます

ソースコード

diff #

from math import gcd
t = int(input())
for _ in range(t):
    n, a, b = map(int, input().split())
    a, b = min(a, b), max(a, b)
    if a == 1:
        print('YES')
    elif gcd(a, b) != 1 or b >= n or a * (b - 1) >= n:
        print('NO')
        exit(1)
    else:
        print('YES')
0