結果
| 問題 | No.3413 あわてんぼうのルクくん |
| コンテスト | |
| ユーザー |
AwashAmityOak
|
| 提出日時 | 2025-12-11 14:37:40 |
| 言語 | PyPy3 (7.3.17) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 227 bytes |
| 記録 | |
| コンパイル時間 | 225 ms |
| コンパイル使用メモリ | 82,288 KB |
| 実行使用メモリ | 77,428 KB |
| 最終ジャッジ日時 | 2025-12-20 00:12:25 |
| 合計ジャッジ時間 | 9,192 ms |
|
ジャッジサーバーID (参考情報) |
judge3 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 1 |
| other | WA * 15 |
ソースコード
import math
Q = int(input())
for q in range(Q):
X, N, d = map(int, input().split())
if math.gcd(X, d) != 1:
print("inf")
continue
ans = max((X - 1) * (d - 1), min(X - 1, N - 1) * d)
print(-1 if ans == 0 else ans)
AwashAmityOak