Moving upwards in table from bottom right to calculate the total time taken to read the topics which can be done in given time and have highest weightage sum
int i = no_of_topics - 1 , j = total_time - 1 ; int sum = 0 ; while ( i > 0 && j > 0 ) {