Step ( 2 ) - Loop for i = 0 to K - 1 and do accordingly
for i in range ( K ) : NEW_LINE INDENT total_points = ( total_points + vec [ i ] [ 0 ] ) NEW_LINE max_rating = max ( max_rating , total_points * vec [ i ] [ 1 ] ) NEW_LINE heapq . heappush ( pq , vec [ i ] [ 0 ] ) NEW_LINE DEDENT