結果
| 問題 | 
                            No.1918 Simple Math ?
                             | 
                    
| コンテスト | |
| ユーザー | 
                             とりゐ
                         | 
                    
| 提出日時 | 2022-03-26 10:45:54 | 
| 言語 | PyPy3  (7.3.15)  | 
                    
| 結果 | 
                             
                                TLE
                                 
                             
                            
                            (最新)
                                AC
                                 
                             
                            (最初)
                            
                            
                         | 
                    
| 実行時間 | - | 
| コード長 | 321 bytes | 
| コンパイル時間 | 140 ms | 
| コンパイル使用メモリ | 82,028 KB | 
| 実行使用メモリ | 82,276 KB | 
| 最終ジャッジ日時 | 2024-06-29 02:07:55 | 
| 合計ジャッジ時間 | 4,937 ms | 
| 
                            ジャッジサーバーID (参考情報)  | 
                        judge4 / judge3 | 
(要ログイン)
| ファイルパターン | 結果 | 
|---|---|
| sample | AC * 1 | 
| other | AC * 5 TLE * 1 -- * 27 | 
ソースコード
def floor_sqrt(n):
  ng,ok=n+1,-1
  while ng-ok>1:
    mid=(ok+ng)//2
    if mid*mid<=n:
      ok=mid
    else:
      ng=mid
  return ok
def solve():
  a,n=map(int,input().split())
  ans=0
  for i in range(1,n+1):
    ans+=floor_sqrt(a*i)
    ans%=mod
  
  print(ans)
mod=10**9+7
for _ in range(int(input())):
  solve()
            
            
            
        
            
とりゐ