Problem list
Log in
#r03209 · Online Judge > GoldOJ

Minimum Assignment Sum (Small)

Silver III 2.0 s 1024 MB

An $N \times N$ matrix is given. Choose exactly one entry from every row and every column (no two chosen entries share a row or a column). Print the minimum possible sum of the chosen entries.

Input

Line 1: $N$ ($1 \le N \le 10$). Next $N$ lines: $N$ integers each ($1 \le$ value $\le 100$).

Output

Print the minimum selectable sum.

Example 1

Input
3
1 2 5
2 4 3
5 4 3
Output
7

Example 2

Input
2
10 20
30 40
Output
50
Source
Online Judge > GoldOJ
Appears in
Not part of a ladder, contest or set yet.
Accepted 0 Submissions 0 Acceptance 0% Solvers 0

Discussion

Threads about this problem. Spoilers are collapsed; wrap hints in ||double bars||.

No discussion yet. Start a thread if something here needs explaining.

Recent submissions Open with filters
Code