A shop packs pens in boxes of and boxes of . How many ways can it fill an order of exactly pens? That is the number of whole-number solutions of , with and both or more.
The idea. Try every from up to . Keep when divides evenly by .
Your tasks.
fits, return True when a * x + b * y equals c.whole_solutions, return the list of pairs (x, y) with and whole and or more.ways to the number of ways to pack the pens.Have you tried it?
Do the tasks in the editor first, and run the checker after each one. Its hints help when a check fails. When you are ready, compare your code with this solution.
Log in to join the discussion.
Loading…