結果
| 問題 |
No.2767 Add to Divide
|
| コンテスト | |
| ユーザー |
titia
|
| 提出日時 | 2024-05-31 22:22:38 |
| 言語 | PyPy3 (7.3.15) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 388 bytes |
| コンパイル時間 | 268 ms |
| コンパイル使用メモリ | 82,292 KB |
| 実行使用メモリ | 208,436 KB |
| 最終ジャッジ日時 | 2024-12-20 23:59:44 |
| 合計ジャッジ時間 | 4,775 ms |
|
ジャッジサーバーID (参考情報) |
judge3 / judge1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 1 |
| other | AC * 13 WA * 3 |
ソースコード
import sys
input = sys.stdin.readline
T=int(input())
for tests in range(T):
A,B=map(int,input().split())
u=B-A
L=[]
for i in range(1,10**5):
if u%i==0:
L.append(i)
L.append(u//i)
ANS=1<<63
for l in L:
if l>=A:
ANS=min(ANS,l-A)
if ANS==1<<63:
print(-1)
else:
print(ANS)
titia