結果
| 問題 |
No.2767 Add to Divide
|
| コンテスト | |
| ユーザー |
titia
|
| 提出日時 | 2024-05-31 22:34:21 |
| 言語 | PyPy3 (7.3.15) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 404 bytes |
| コンパイル時間 | 439 ms |
| コンパイル使用メモリ | 82,228 KB |
| 実行使用メモリ | 268,860 KB |
| 最終ジャッジ日時 | 2024-12-21 00:15:31 |
| 合計ジャッジ時間 | 26,744 ms |
|
ジャッジサーバーID (参考情報) |
judge1 / judge5 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| 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**6):
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:
ANS=-1
print(ANS)
else:
print(ANS)
titia