You are given problems. The problems are of three types, 'Type1', 'Type2', and 'Type3'. There are 'Type1' problems, 'Type2' problems, and 'Type3' problems. You can solve each problem using any of the three methods, 'A', 'B', and 'C'. You can use a particular method only a limited number of times that is, method 'A' for times, method 'B' for times, and method 'C' for times.
You are given a matrix where represents the effort to solve a Type problem using Method . You are required to find the minimum effort required to solve all the problems.
Input format
Output format
For each test case, print the minimum effort required to solve all the problems in a new line.
Constraints
(sum of , , and is equal to )
(sum of , , and is equal to )
For the only testcase, the optimal solution is -
Thus, total effort is .