xay loves matrices
时间限制:C/C++/Rust/Pascal 2秒,其他语言4秒
空间限制:C/C++/Rust/Pascal 512 M,其他语言1024 M
64bit IO Format: %lld

题目描述

Xay has an  matrix , and he wants to calculate its determinant.
After baidu-ing linear algebra, Xay realized how simple this task is.
Now he wants to make it harder.
Suppose every element of this matrix is a polynomial with degree not more than d. It's easy to see that its determinant is a polynomial with degree not more than nd.
Can you find this polynomial?

输入描述:

The first line contains two integers n, d respectively().
Then  lines follow, each line contains n integers.
The j-th number of the k*n+i-th line indicates the coefficient of  in  ().
It's guaranteed that all coefficients are in range .

输出描述:

Output the coefficients of  in increasing order.
Note that even if  , you still have to output nd+1 numbers.
Since the answer might be big, you only have to output the coefficients modulo .
示例1

输入

复制
2 1
1 1
0 0
0 0
2 3

输出

复制
0 1 0