Given a 3∗N matrix. In one operation you can swap any two-column and you can perform this operation any number of times (including zero). Find the minimum possible value of the given function after performing this operation any number of times (including zero). As this value may become very large, so output the answer modulo 109+7. The function is given below:
Input Format:
Output Format:
Constraints:
We can swap 1'st and 2'nd column and the answer will be 2 * (1 * 20 + 2 * 2) + 1 * (2 * 2) = 52 and this the minimum possible answer.