There is a sequence of tiles. Each tile will have a three numbers on it. In that tiles you can do following operations
let say tiles will have a numbers like this a0,b0,c0,a1,b1,c1,......an,bn,cn
By picking the numbers, you have to maximize the sum of these elements.
Input:
number of tiles : 4
2 3 1
7 9 8
4 5 6
2 3 22
output : 35
explanation : if we choose left element from first 3 tiles and getting a right element from fourth tile we can get the maximum sum