@@ -0,0 +1,1117 @@
+#!/usr/bin/env python%0A#-*-coding:utf-8-*-%0A%0A'''%0A'''%0A%0Aimport timeit%0A%0A# slow%0Adef loop(total):%0A    cnt = 0%0A    for i in range(int(total/200)+1):%0A        for j in range(int(total/100)+1):%0A            for k in range(int(total/50)+1):%0A                for l in range(int(total/20)+1):%0A                    for m in range(int(total/10)+1):%0A                        for n in range(int(total/5)+1):%0A                            for o in range(int(total/2)+1):%0A                                if i*200+j*100+k*50+l*20++m*10+n*5+o*2 %3C= total:%0A                                    cnt += 1%0A    return cnt%0A%0A# fast%0Adef recursive(total, coins):%0A    if coins == %5B1%5D:%0A        return 1%0A    cnt = 0%0A    for i in range(0, int(total/coins%5B0%5D)+1):%0A        cnt += recursive(total-coins%5B0%5D*i, coins%5B1:%5D)%0A    return cnt%0A%0A%0Aif __name__ == '__main__':%0A    print loop(200)%0A    print recursive(200, %5B200, 100, 50, 20, 10, 5, 2, 1%5D)%0A    print timeit.Timer('problem_031.loop(200)', 'import problem_031').timeit(1)%0A    print timeit.Timer('problem_031.recursive(200, %5B200, 100, 50, 20, 10, 5, 2, 1%5D)',%0A                       'import problem_031').timeit(1)%0A

add problem 031