a thoughtful web.
Good ideas and conversation. No ads, no tracking.   Login or Take a Tour!
comment by briandmyers
briandmyers  ·  3369 days ago  ·  link  ·    ·  parent  ·  post: A nice problem from SICP

Here's the output (or run it yourself, if you have gcc) :

    Coin 1 cents has max 100 for goal

    Coin 5 cents has max 20 for goal

    Coin 10 cents has max 10 for goal

    Coin 25 cents has max 4 for goal

    Coin 50 cents has max 2 for goal

    Good set : 0 0 0 0 2

    Good set : 0 0 0 2 1

    Good set : 0 0 0 4 0

    Good set : 0 0 5 0 1

    Good set : 0 0 5 2 0

    Good set : 0 0 10 0 0

    Good set : 0 1 2 1 1

    Good set : 0 1 2 3 0

    Good set : 0 1 7 1 0

    Good set : 0 2 4 0 1

    Good set : 0 2 4 2 0

    Good set : 0 2 9 0 0

    Good set : 0 3 1 1 1

    Good set : 0 3 1 3 0

    Good set : 0 3 6 1 0

    Good set : 0 4 3 0 1

    Good set : 0 4 3 2 0

    Good set : 0 4 8 0 0

    Good set : 0 5 0 1 1

    Good set : 0 5 0 3 0

    Good set : 0 5 5 1 0

    Good set : 0 6 2 0 1

    Good set : 0 6 2 2 0

    Good set : 0 6 7 0 0

    Good set : 0 7 4 1 0

    Good set : 0 8 1 0 1

    Good set : 0 8 1 2 0

    Good set : 0 8 6 0 0

    Good set : 0 9 3 1 0

    Good set : 0 10 0 0 1

    Good set : 0 10 0 2 0

    Good set : 0 10 5 0 0

    Good set : 0 11 2 1 0

    Good set : 0 12 4 0 0

    Good set : 0 13 1 1 0

    Good set : 0 14 3 0 0

    Good set : 0 15 0 1 0

    Good set : 0 16 2 0 0

    Good set : 0 18 1 0 0

    Good set : 0 20 0 0 0

    Good set : 5 0 2 1 1

    Good set : 5 0 2 3 0

    Good set : 5 0 7 1 0

    Good set : 5 1 4 0 1

    Good set : 5 1 4 2 0

    Good set : 5 1 9 0 0

    Good set : 5 2 1 1 1

    Good set : 5 2 1 3 0

    Good set : 5 2 6 1 0

    Good set : 5 3 3 0 1

    Good set : 5 3 3 2 0

    Good set : 5 3 8 0 0

    Good set : 5 4 0 1 1

    Good set : 5 4 0 3 0

    Good set : 5 4 5 1 0

    Good set : 5 5 2 0 1

    Good set : 5 5 2 2 0

    Good set : 5 5 7 0 0

    Good set : 5 6 4 1 0

    Good set : 5 7 1 0 1

    Good set : 5 7 1 2 0

    Good set : 5 7 6 0 0

    Good set : 5 8 3 1 0

    Good set : 5 9 0 0 1

    Good set : 5 9 0 2 0

    Good set : 5 9 5 0 0

    Good set : 5 10 2 1 0

    Good set : 5 11 4 0 0

    Good set : 5 12 1 1 0

    Good set : 5 13 3 0 0

    Good set : 5 14 0 1 0

    Good set : 5 15 2 0 0

    Good set : 5 17 1 0 0

    Good set : 5 19 0 0 0

    Good set : 10 0 4 0 1

    Good set : 10 0 4 2 0

    Good set : 10 0 9 0 0

    Good set : 10 1 1 1 1

    Good set : 10 1 1 3 0

    Good set : 10 1 6 1 0

    Good set : 10 2 3 0 1

    Good set : 10 2 3 2 0

    Good set : 10 2 8 0 0

    Good set : 10 3 0 1 1

    Good set : 10 3 0 3 0

    Good set : 10 3 5 1 0

    Good set : 10 4 2 0 1

    Good set : 10 4 2 2 0

    Good set : 10 4 7 0 0

    Good set : 10 5 4 1 0

    Good set : 10 6 1 0 1

    Good set : 10 6 1 2 0

    Good set : 10 6 6 0 0

    Good set : 10 7 3 1 0

    Good set : 10 8 0 0 1

    Good set : 10 8 0 2 0

    Good set : 10 8 5 0 0

    Good set : 10 9 2 1 0

    Good set : 10 10 4 0 0

    Good set : 10 11 1 1 0

    Good set : 10 12 3 0 0

    Good set : 10 13 0 1 0

    Good set : 10 14 2 0 0

    Good set : 10 16 1 0 0

    Good set : 10 18 0 0 0

    Good set : 15 0 1 1 1

    Good set : 15 0 1 3 0

    Good set : 15 0 6 1 0

    Good set : 15 1 3 0 1

    Good set : 15 1 3 2 0

    Good set : 15 1 8 0 0

    Good set : 15 2 0 1 1

    Good set : 15 2 0 3 0

    Good set : 15 2 5 1 0

    Good set : 15 3 2 0 1

    Good set : 15 3 2 2 0

    Good set : 15 3 7 0 0

    Good set : 15 4 4 1 0

    Good set : 15 5 1 0 1

    Good set : 15 5 1 2 0

    Good set : 15 5 6 0 0

    Good set : 15 6 3 1 0

    Good set : 15 7 0 0 1

    Good set : 15 7 0 2 0

    Good set : 15 7 5 0 0

    Good set : 15 8 2 1 0

    Good set : 15 9 4 0 0

    Good set : 15 10 1 1 0

    Good set : 15 11 3 0 0

    Good set : 15 12 0 1 0

    Good set : 15 13 2 0 0

    Good set : 15 15 1 0 0

    Good set : 15 17 0 0 0

    Good set : 20 0 3 0 1

    Good set : 20 0 3 2 0

    Good set : 20 0 8 0 0

    Good set : 20 1 0 1 1

    Good set : 20 1 0 3 0

    Good set : 20 1 5 1 0

    Good set : 20 2 2 0 1

    Good set : 20 2 2 2 0

    Good set : 20 2 7 0 0

    Good set : 20 3 4 1 0

    Good set : 20 4 1 0 1

    Good set : 20 4 1 2 0

    Good set : 20 4 6 0 0

    Good set : 20 5 3 1 0

    Good set : 20 6 0 0 1

    Good set : 20 6 0 2 0

    Good set : 20 6 5 0 0

    Good set : 20 7 2 1 0

    Good set : 20 8 4 0 0

    Good set : 20 9 1 1 0

    Good set : 20 10 3 0 0

    Good set : 20 11 0 1 0

    Good set : 20 12 2 0 0

    Good set : 20 14 1 0 0

    Good set : 20 16 0 0 0

    Good set : 25 0 0 1 1

    Good set : 25 0 0 3 0

    Good set : 25 0 5 1 0

    Good set : 25 1 2 0 1

    Good set : 25 1 2 2 0

    Good set : 25 1 7 0 0

    Good set : 25 2 4 1 0

    Good set : 25 3 1 0 1

    Good set : 25 3 1 2 0

    Good set : 25 3 6 0 0

    Good set : 25 4 3 1 0

    Good set : 25 5 0 0 1

    Good set : 25 5 0 2 0

    Good set : 25 5 5 0 0

    Good set : 25 6 2 1 0

    Good set : 25 7 4 0 0

    Good set : 25 8 1 1 0

    Good set : 25 9 3 0 0

    Good set : 25 10 0 1 0

    Good set : 25 11 2 0 0

    Good set : 25 13 1 0 0

    Good set : 25 15 0 0 0

    Good set : 30 0 2 0 1

    Good set : 30 0 2 2 0

    Good set : 30 0 7 0 0

    Good set : 30 1 4 1 0

    Good set : 30 2 1 0 1

    Good set : 30 2 1 2 0

    Good set : 30 2 6 0 0

    Good set : 30 3 3 1 0

    Good set : 30 4 0 0 1

    Good set : 30 4 0 2 0

    Good set : 30 4 5 0 0

    Good set : 30 5 2 1 0

    Good set : 30 6 4 0 0

    Good set : 30 7 1 1 0

    Good set : 30 8 3 0 0

    Good set : 30 9 0 1 0

    Good set : 30 10 2 0 0

    Good set : 30 12 1 0 0

    Good set : 30 14 0 0 0

    Good set : 35 0 4 1 0

    Good set : 35 1 1 0 1

    Good set : 35 1 1 2 0

    Good set : 35 1 6 0 0

    Good set : 35 2 3 1 0

    Good set : 35 3 0 0 1

    Good set : 35 3 0 2 0

    Good set : 35 3 5 0 0

    Good set : 35 4 2 1 0

    Good set : 35 5 4 0 0

    Good set : 35 6 1 1 0

    Good set : 35 7 3 0 0

    Good set : 35 8 0 1 0

    Good set : 35 9 2 0 0

    Good set : 35 11 1 0 0

    Good set : 35 13 0 0 0

    Good set : 40 0 1 0 1

    Good set : 40 0 1 2 0

    Good set : 40 0 6 0 0

    Good set : 40 1 3 1 0

    Good set : 40 2 0 0 1

    Good set : 40 2 0 2 0

    Good set : 40 2 5 0 0

    Good set : 40 3 2 1 0

    Good set : 40 4 4 0 0

    Good set : 40 5 1 1 0

    Good set : 40 6 3 0 0

    Good set : 40 7 0 1 0

    Good set : 40 8 2 0 0

    Good set : 40 10 1 0 0

    Good set : 40 12 0 0 0

    Good set : 45 0 3 1 0

    Good set : 45 1 0 0 1

    Good set : 45 1 0 2 0

    Good set : 45 1 5 0 0

    Good set : 45 2 2 1 0

    Good set : 45 3 4 0 0

    Good set : 45 4 1 1 0

    Good set : 45 5 3 0 0

    Good set : 45 6 0 1 0

    Good set : 45 7 2 0 0

    Good set : 45 9 1 0 0

    Good set : 45 11 0 0 0

    Good set : 50 0 0 0 1

    Good set : 50 0 0 2 0

    Good set : 50 0 5 0 0

    Good set : 50 1 2 1 0

    Good set : 50 2 4 0 0

    Good set : 50 3 1 1 0

    Good set : 50 4 3 0 0

    Good set : 50 5 0 1 0

    Good set : 50 6 2 0 0

    Good set : 50 8 1 0 0

    Good set : 50 10 0 0 0

    Good set : 55 0 2 1 0

    Good set : 55 1 4 0 0

    Good set : 55 2 1 1 0

    Good set : 55 3 3 0 0

    Good set : 55 4 0 1 0

    Good set : 55 5 2 0 0

    Good set : 55 7 1 0 0

    Good set : 55 9 0 0 0

    Good set : 60 0 4 0 0

    Good set : 60 1 1 1 0

    Good set : 60 2 3 0 0

    Good set : 60 3 0 1 0

    Good set : 60 4 2 0 0

    Good set : 60 6 1 0 0

    Good set : 60 8 0 0 0

    Good set : 65 0 1 1 0

    Good set : 65 1 3 0 0

    Good set : 65 2 0 1 0

    Good set : 65 3 2 0 0

    Good set : 65 5 1 0 0

    Good set : 65 7 0 0 0

    Good set : 70 0 3 0 0

    Good set : 70 1 0 1 0

    Good set : 70 2 2 0 0

    Good set : 70 4 1 0 0

    Good set : 70 6 0 0 0

    Good set : 75 0 0 1 0

    Good set : 75 1 2 0 0

    Good set : 75 3 1 0 0

    Good set : 75 5 0 0 0

    Good set : 80 0 2 0 0

    Good set : 80 2 1 0 0

    Good set : 80 4 0 0 0

    Good set : 85 1 1 0 0

    Good set : 85 3 0 0 0

    Good set : 90 0 1 0 0

    Good set : 90 2 0 0 0

    Good set : 95 1 0 0 0

    Good set : 100 0 0 0 0

    Found 292 solutions.