$ 0 0 check out the following test cases...8 6,1 2,2 3,4 5,5 6,6 7,7 4,1,2,-1,-1,-1,-1,-1,-1 ans=-16 5,1 2,4 5,5 6,6 3,3 1,1,2,3,4,5,6 ans=010 8,1 2,2 3,4 5,5 6,7 8,8 9,3 1,6 2,1,2,3,-1,-1,5,-1,-1,-1,2 ans=-1