The error is because that you want to divide the total cost by 2m but your implementation isn’t correct as you want to do square brackets around the division term like …/(2m) because divide only on …/2 * m it’s lead to divide the total cost only by 2