public class PackingDemo { public static int boxesNeeded(int itemCount, int capacity) { if (itemCount < 0 || itemCount > 10000) { throw new IllegalArgumentException("Item count must be 0 to 10000"); } if (capacity < 1 || capacity > 1000) { throw new IllegalArgumentException("Capacity must be 1 to 1000"); } if (itemCount == 0) { return 0; } return 1 + (itemCount - 1) / capacity; } public static void main(String[] args) { int itemCount = 29; int capacity = 12; int boxes = boxesNeeded(itemCount, capacity); System.out.println("Postcard packs: " + itemCount); System.out.println("Packs per box: " + capacity); System.out.println("Boxes needed: " + boxes); } }