problem1c based on Matloff's scheduling example