using System.Collections.Generic;
public static void Main()
var order = MakeOrder(n);
", order.num50, order.num50 * 50, order.num25, order.num25 * 25, order.num10, order.num10 * 10, order.num8, order.num8 * 8, order.num5, order.num5 * 5, order.GetSum());
public static int GetNumberOf8Packs(int orderCount)
int remainder = (orderCount % 5);
return ((remainder % 3) * 5 + remainder) / 3;
public static Order MakeOrder(int orderSize)
throw new NotImplementedException("You'll have to write this part, since the modular arithmetic for 8-packs starts working at 40.");
order.num8 = GetNumberOf8Packs(orderSize);
int multipleOf5 = orderSize - (order.num8 * 8);
order.num50 = multipleOf5 / 50;
int remainderFrom50 = multipleOf5 % 50;
while (remainderFrom50 > 0)
if (remainderFrom50 >= 25)
else if (remainderFrom50 >= 10)
else if (remainderFrom50 >= 5)
return this.num50 * 50 + this.num25 * 25 + this.num10 * 10 + this.num8 * 8 + this.num5 * 5;