@@ -0,0 +1,374 @@
+// https://community.topcoder.com/stat?c=problem_statement&pm=10007%0A%0Aimport java.util.Arrays;%0A%0Apublic class RoyalTreasurer %7B%0A%09public static int minimalArrangement(int%5B%5D A, int%5B%5D B) %7B%0A%09%09Arrays.sort(A);%0A%09%09Arrays.sort(B);%0A%09%09%0A%09%09int i = 0;%0A%09%09int j = B.length-1;%0A%09%09int minSum = 0;%0A%09%09%0A%09%09while (i %3C A.length) %7B%0A%09%09%09minSum += A%5Bi%5D * B%5Bj%5D;%0A%09%09%09i++;%0A%09%09%09j--;%0A%09%09%7D%0A%09%09%0A%09%09return minSum;%0A%09%7D%0A%7D%0A

Create RoyalTreasurer.java