Assignment problem
Very easy
Execution time limit is 1 second
Runtime memory usage limit is 128 megabytes
One of the classical problems of combinatorial optimization is the "assignment problem". It is formulated as follows.
There are workers, numbered from to , and jobs, numbered from to . If the -th worker is assigned to the -th job, he gets salary money. Find such assignment of workers to the jobs (each worker can perform only one job, each job is performed by only one worker) so that the total worker's salary is minimized (the corresponding sum is called the cost of assignment).
Write the program to solve the assignment problem.
Input
First line contains one integer .
Each of the next lines contains integers. The -th number of the -th line equals to .
Output
Print the minimum possible cost of assignment.
Examples
Input #1
Answer #1
Input #2
Answer #2
Submissions 792
Acceptance rate 56%