#P10950. [2015杭电多校]MZL's game

[2015杭电多校]MZL's game

MZL's game

Problem Description

MZL has nn cute boys.They are playing a game♂.The game will run in turn First,System choose an alive player xx randomly.Player xx will be out of the game. Then player x will attack all alive players in the game When a player is attacked,1p1-p is the probability of he still lives,pp is the probability of he dies Now mzl wants to know:the probability of one player be out of the game and be attacked kk times You need to print the probability mod 258280327 for every k from 0 to n-1 According to Fermat Theory,xy\frac{x}{y} mod 258280327=x*(y258280325)(y^{258280325}) mod 258280327 pp will be given in a special way

Input

The first line of the input contains a single number TT, the number of test cases. Next TT lines, each line contains three integer nn,xx,yy.p=xyp=\frac{x}{y} T5T\leq 5, n2103n\leq 2*10^3 0x1090 \leq x \leq 10^9 x+1y109x+1 \leq y \leq 10^9. It is guaranteed that y and 258280327 are coprime.

Output

TT lines, every line n numbers: the ans from 0 to n-1

Sample Input

2
3 33 100
9 23 233

Sample Output

172186885 210128265 223268793
229582513 70878931 75916746 175250440 21435537 57513225 236405985 111165243 115953819

Hint

for case 1: The probability of you live and not be attacked is 1/3 The probability of you live and be attacked for one time is: (2/3)(0.330.67+0.670.67(1/2))=8911/30000

Author

SXYZ

Source

2015 Multi-University Training Contest 5