You are given two vectors
Suppose you are allowed to permute the coordinates of each vector as you wish. Choose two permutations such that the scalar product of your two new vectors is the smallest possible, and output that minimum scalar product.
Input Specification
The first line of the input file contains integer number
The next two lines contain
Output Specification
For each test case, output a line Case #X: Y
where
Limits
Time limit: 30 seconds per test set.
Memory limit: 1 GB.
Small Dataset
Large Dataset
Sample Input
2
3
1 3 -5
-2 4 1
5
1 2 3 4 5
1 0 1 0 1
Sample Output
Case #1: -25
Case #2: 6
Comments