Skewness
题号:NC52854
时间限制:C/C++/Rust/Pascal 5秒,其他语言10秒
空间限制:C/C++/Rust/Pascal 32 M,其他语言64 M
Special Judge, 64bit IO Format: %lld

题目描述

Bobo has a matrix A with n rows and n columns.
For submatrix with upper-left corner (x_1, y_1) and lower-right corner (x_2, y_2) (),
he defined its *skewness* .
Bobo would like to know the sum of *skewness* of all submatrices modulo .

输入描述:

The input contains zero or more test cases and is terminated by end-of-file. For each test case:
The first line contains an integer n.
The i-th of following n lines contains n integers .

*
*
* The number of test cases does not exceed 10.

输出描述:

For each case, output an integer which denotes the sum.
示例1

输入

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

输出

复制
14
448