1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 | x = int(raw_input('Enter the size of the 1st package: ')) y = int(raw_input('Enter the size of the 2nd package: ')) z = int(raw_input('Enter the size of the 3rd package: ')) for n in range(1,200): solutions = () # use this to store the solutions for a in range(0,n): for b in range(0,n): for c in range(0,n): if x*a + y*b + z*c == n: solutions = solutions + ((a,b,c),) break if len(solutions) == 0: # this means no solutions for the current n bestSoFar = n print bestSoFar |

This paste never expires.
View raw.
Pasted through *import*.