#P1234. Youmu with the determinant (hard version)
Youmu with the determinant (hard version)
题目描述
As walking down the stairs of the literally Tower of White Jade, Youmu can't stop thinking about the determinant which she learned on the books as her leisure time.
Now, Youmu just wants to write a program on how to calculate the determinant, but now she has arrived at the end of the stairs of the literally Tower of White Jade and is about to leave the Netherworld. So she has no time to do that, can you write a program for calculating the determinant for her?
As the answer may be quite huge, please modular the answer .
picture: the stairs of the literally Tower of White Jade
输入格式
The first line of the input contains one positive integer indicating the order of the determinant.
Then follows sizes of positive integers indicating the number in the determinant.
输出格式
The answer
样例
2
4 5
1 9
31
4
1 4 -1 4
2 1 4 3
4 2 3 11
3 0 9 2
10
2
4 5
-1 -9
999999976