def compute_sum(jobs, order):
    """Given the jobs list and order, find the weighted sum of the jobs.
    """
    finish_time = 0
    weighted_sum = 0
    for i in order:
        
        finish_time += jobs[i][1]
        weighted_sum += finish_time*jobs[i][0]
        
    return weighted_sum