結果
| 問題 | 
                            No.1281 Cigarette Distribution
                             | 
                    
| コンテスト | |
| ユーザー | 
                             taiga000629
                         | 
                    
| 提出日時 | 2020-11-06 21:57:28 | 
| 言語 | PyPy3  (7.3.15)  | 
                    
| 結果 | 
                             
                                WA
                                 
                             
                            
                         | 
                    
| 実行時間 | - | 
| コード長 | 485 bytes | 
| コンパイル時間 | 410 ms | 
| コンパイル使用メモリ | 82,304 KB | 
| 実行使用メモリ | 76,288 KB | 
| 最終ジャッジ日時 | 2024-07-22 12:45:27 | 
| 合計ジャッジ時間 | 3,077 ms | 
| 
                            ジャッジサーバーID (参考情報)  | 
                        judge1 / judge4 | 
(要ログイン)
| ファイルパターン | 結果 | 
|---|---|
| other | AC * 3 WA * 20 | 
ソースコード
n,m=map(int,input().split())
mod=10**9+7
for x in range(1,m+1):
    if x==n:
        print(0)
    else:
        if n%x==0:
            print(pow(n//x,x,mod))
        else:
            hon=n//x
            amari=n-x*hon
            if hon>1:
                print(pow(hon+1,amari,mod)*pow(hon,x-amari,mod)%mod)
            else:
                if x-amari>1:
                    print(0)
                else:
                    print(pow(hon+1,amari,mod)*pow(hon,x-amari,mod)%mod)
            
            
            
        
            
taiga000629