Step ( 2 ) - Loop for i = 0 to K - 1 and do accordingly
for ( int i = 0 ; i < K ; i ++ ) { total_points = total_points + vec [ i ] . first ; max_rating = max ( max_rating , total_points * vec [ i ] . second ) ; pq . push ( vec [ i ] . first ) ; }