LearnPy Hub
← Arena
AdvancedRating 1500

Determinant

Print the determinant of an n×n integer matrix (n ≤ 6) using fractions for exact arithmetic.

Input

n, then n lines.

Output

An integer.

Sample 1

Input
2
1 2
3 4
Output
-2

Sample 2

Input
1
7
Output
7
solution.py
Output appears here
Determinant · Python Arena problem · LearnPy Hub