Armageddon

시간 제한1초메모리 제한1024 MB

요약
마나 k를 1부터 n까지 쓸 때 x+y+z=k인 음이 아닌 정수 x, y, z에 대해 x(x+1)/2 · y(y+1)/2 · a^z의 최댓값을 구해 10^9+7로 나눈 값을 출력한다.
난이도

어려움10점 중 8점

유형
동적 계획법, 수학, 완전 탐색, 정수론
정답자
아직 제출이 없습니다

문제

Cocoa, the magic sword president of RUN, has obtained a new magic sword named Armageddon. To maximize its power, Cocoa intends to enhance it.

Specifically, the sword's power is determined by its length xx, enchantment level yy, and brilliance zz, according to the formula:

x(x+1)2⋅y(y+1)2⋅az\frac{x(x+1)}{2}\cdot\frac{y(y+1)}{2}\cdot a^z

where x,y,zx,y,z are nonnegative integers. Here, aa is a fixed constant determined when Armageddon was forged. Initially, x,y,zx,y,z are all initialized to 0.

Cocoa can invest her mana to improve the sword. For each 11 mana spent, she can increase either xx, yy, or zz by 11.

For each k=1,2,⋯ ,nk = 1, 2, \cdots, n, determine the maximum possible power of the sword if Cocoa uses exactly kk mana to enhance the sword.

입력

The first line contains three integers pp, qq, and nn separated by spaces, where a=p/qa = p/q.

출력

Print nn values in a single line, separated by spaces.

For the ii-th value, output s×t−1(mod109+7)s \times t^{-1} \pmod{10^9+7}, where s/ts/t is the irreducible fraction representing the maximum possible power after investing exactly ii mana.

제한

  • 1≤p,q,n≤1051 \le p, q, n \le 10^5

힌트

There is no magic sword president in RUN.

예제3

  1. 예제 1

    입력
    1 1 10
    
    예상 출력
    0 1 3 9 18 36 60 100 150 225
    
  2. 예제 2

    입력
    2 1 10
    
    예상 출력
    0 1 3 9 18 36 72 144 288 576
    
  3. 예제 3

    입력
    100000 1 5
    
    예상 출력
    0 1 100000 999999937 993000007