set initial value
for ( int i = 0 ; i < 5 ; i ++ ) for ( int i1 = 0 ; i1 < 5 ; i1 ++ ) for ( int i2 = 0 ; i2 < 5 ; i2 ++ ) cache [ i ] [ i1 ] [ i2 ] = - 1 ; System . out . println ( maxSumPath ( 0 , 0 , 0 ) ) ; } }