結果
| 問題 | 
                            No.1243 約数加算
                             | 
                    
| コンテスト | |
| ユーザー | 
                             mkawa2
                         | 
                    
| 提出日時 | 2020-10-02 23:01:19 | 
| 言語 | Python3  (3.13.1 + numpy 2.2.1 + scipy 1.14.1)  | 
                    
| 結果 | 
                             
                                WA
                                 
                             
                            
                         | 
                    
| 実行時間 | - | 
| コード長 | 1,549 bytes | 
| コンパイル時間 | 103 ms | 
| コンパイル使用メモリ | 12,800 KB | 
| 実行使用メモリ | 18,076 KB | 
| 最終ジャッジ日時 | 2024-07-17 23:07:16 | 
| 合計ジャッジ時間 | 4,815 ms | 
| 
                            ジャッジサーバーID (参考情報)  | 
                        judge5 / judge3 | 
(要ログイン)
| ファイルパターン | 結果 | 
|---|---|
| sample | WA * 1 | 
| other | WA * 4 TLE * 1 -- * 4 | 
ソースコード
from operator import itemgetter
from itertools import *
from bisect import *
from collections import *
from heapq import *
import sys
sys.setrecursionlimit(10**6)
int1 = lambda x: int(x)-1
p2D = lambda x: print(*x, sep="\n")
def II(): return int(sys.stdin.buffer.readline())
def MI(): return map(int, sys.stdin.buffer.readline().split())
def MI1(): return map(int1, sys.stdin.buffer.readline().split())
def LI(): return list(map(int, sys.stdin.buffer.readline().split()))
def LI1(): return list(map(int1, sys.stdin.buffer.readline().split()))
def LLI(rows_number): return [LI() for _ in range(rows_number)]
def SI(): return sys.stdin.buffer.readline()[:-1]
def LLI1(rows_number): return [LI1() for _ in range(rows_number)]
dij = [(1, 0), (0, 1), (-1, 0), (0, -1)]
def factors(a):
    if a<=0:return [0]
    low=[]
    high=[]
    for d in range(1,a+1):
        if d*d>a:break
        if a%d:continue
        low.append(d)
        high.append(a//d)
    if low[-1]==high[-1]:high.pop()
    return low+high[::-1]
def nearf(a,s):
    if a<=s:return a
    if s**2<a:
        for d in range(s,0,-1):
            if a%d==0:return d
    else:
        s1=a//s
        # print(a,s,s1)
        for d in range(s1,a+1):
            if d**2>a:break
            if a%d==0:return a//d
        for d in range(s1,0,-1):
            if a%d==0:return d
def solve(a,b):
    ans=[]
    while a<b:
        f=nearf(a,b-a)
        ans.append(f)
        # print(a,f,ans)
        a+=f
    print(*ans)
    print(len(ans))
for _ in range(II()):
    a,b=MI()
    solve(a,b)
            
            
            
        
            
mkawa2