Cheapest Assignment
There are n workers and n jobs. Worker i can do job j at a cost of c_{i,j}.
Every worker must get exactly one job, and every job must be given to exactly one worker. Find the minimum possible total cost of such an assignment.
Input
The first line contains an integer n (1 ≤ n ≤ 20).
Each of the next n lines contains n integers. The j-th integer of the i-th line is c_{i,j} (0 ≤ c_{i,j} ≤ 10^9), the cost of worker i doing job j.
Output
Print one integer: the minimum total cost.
Notes
In the first example, the best assignment gives job 2 to worker 1, job 1 to worker 2 and job 3 to worker 3, for a total of 2 + 3 + 4 = 9. Giving worker 1 their cheapest job (job 1, cost 1) looks tempting, but then the cheapest way to finish costs 13 more, for a total of 14.
In the second example there is only one worker and one job.
The answer may not fit in a 32-bit integer.