410485: GYM104025 K ZYW with tutors

Memory Limit:256 MB Time Limit:1 S
Judge Style:Text Compare Creator:
Submit:0 Solved:0

Description

K. ZYW with tutorstime limit per test1 secondmemory limit per test256 megabytesinputstandard inputoutputstandard output

ZYW has high academic abilities so many tutors want to work with ZYW. However, ZYW did not want to choose casually, so he gave the tutors a task. The tutor who achieves the best results will be favored by ZYW.

The problem is as follows. Given a $$$n \times n$$$ matrix $$$A$$$, you can choose a number in the matrix and change it to any real number, but you can only do this at most once. You need to minimize $$$|\det(A)|$$$, where $$$\det(A)$$$ represents the determinant of the matrix $$$A$$$.

ZYW can of course compute the result immediately, but your tutor is not very good at this. Can you help your tutor? Note that you do not need to output exactly how the change was made.

Input

The first line contains an integer $$$n\ (1\le n\le 100)$$$.

For the following $$$n$$$ lines, each line contains $$$n$$$ integers, where the $$$j$$$-th number of the $$$i$$$-th line indicates $$$A_{i,j}\ (-10^9\le A_{i,j}\le 10^9)$$$.

Output

Print a single number — the minimum value of $$$|\det(A)|$$$.

If the standard answer is $$$a$$$, and your answer is $$$b$$$, your answer will be considered correct if $$$|\frac{a-b}{\max(a,1)}|<10^{-6}$$$.

ExampleInput
3
1 1 4
5 1 4
0 0 0
Output
0

加入题单

上一题 下一题 算法标签: