Given an array of job difficulties (jobs must be completed in order) and an integer d (number of days), return the minimum total difficulty when each day takes the maximum difficulty of jobs done that day. Each day must have at least one job. Return -1 if impossible.