Sequences + Longest Common Subsequence
Two arrays of positive integers are given:
b1..n. Find the permutation
in of numbers 1, 2, ..., n, for which the sum
bi1 + ... +
is minimal. Each number must be included in permutation only once.
The first line contains the number of elements n (n ≤ 100) in arrays. The second line contains the elements of the first array, and the third line contains the elements of the second array. The array elements do not exceed
Print the minimal value of required sum.
5 7 2 4 3 10 5 11 6 9 6