def extract_jobs(filename):
    """Extract total number of jobs, job weight, length.

        Args:
            filename: text file with job data

        Returns:
           (int, list of tuples) -> (total num of jobs, [(weight, length), ...])
    """

    total = 0
    jobs = []
    with open(filename) as f:
        total = int(f.readline())
        for job in f:
            jobs.append(tuple(int(i) for i in job.split()))

    return total, jobs