| 2024-2025 ICPC, Swiss Subregional |
|---|
| Finished |
You're given an $$$n \times n$$$ matrix $$$A$$$. The minor $$$M_{ij}$$$ of $$$A$$$ in $$$(i,j)$$$ is the determinant of the matrix obtained from $$$A$$$ by deleting the $$$i$$$-th row and the $$$j$$$-th column. Your task is to find all minors of $$$A$$$.
First line of input contains a single integer $$$n$$$ ($$$2 \leq n \leq 500$$$).
The $$$i$$$-th of the following $$$n$$$ lines contains $$$n$$$ numbers $$$A_{i1},\dots,A_{in}$$$, the $$$i$$$-th row of $$$A$$$ ($$$0 \leq A_{ij} \lt 10^9+7$$$).
Print $$$n$$$ lines, containing $$$n$$$ numbers each.
The $$$i$$$-th line should contain $$$M_{i1},\dots,M_{in}$$$, the minors of $$$A$$$.
Since the resulting numbers can be very big, print them modulo $$$10^9+7$$$.
20 11 1
1 1 1 0
30 0 00 0 00 0 0
0 0 0 0 0 0 0 0 0
31 2 34 5 67 8 9
1000000004 1000000001 1000000004 1000000001 999999995 1000000001 1000000004 1000000001 1000000004
In the third example, the matrix $$$M$$$ is given as follows:
$$$$$$ M = -\begin{pmatrix} 3 & 6 & 3 \\ 6 & 12 & 6 \\ 3 & 6 & 3 \end{pmatrix} $$$$$$
| Name |
|---|


