Scheduling to minimize the total resource consumption with a constraint on the sum of completion times