Scheduling Loans for Optimal Repayment