What is solution idea for the Solving the Practise Contest ? Is it related to finding recurrence and solving in O(log n) using exponentation or can it be solved using combinatorics ? asked 02 Nov '14, 13:03

Yes, the problem can be solved by finding a recurrence relation and then using matrix exponentiation. The DP state is: DP[i][x][y][z] represents the number of ways of distributing i problems such that
We made a matrix of 40x40 (10 * 2 * 2) for the matrix exponentiation. answered 02 Nov '14, 20:12
