Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ## 6a + 9b + 20c = x
- ## x >= 50 for all non-negative integers a b c
- a = 6
- b = 9
- c = 20
- aOrders = 0
- bOrders = 0
- cOrders = 0
- result = 0
- for i in range(50,56):
- testValue = i
- cOrders = 0
- while(cOrders * c < testValue):
- bOrders = 0
- while(bOrders * b < testValue):
- aOrders = 0
- while(aOrders * a < testValue):
- if (a*aOrders)+(b*bOrders)+(c*cOrders) == testValue:
- result = (aOrders,bOrders,cOrders)
- print str(result) + ' combines to ' + str(testValue)
- aOrders = aOrders + 1
- bOrders = bOrders + 1
- cOrders = cOrders + 1
Advertisement
Add Comment
Please, Sign In to add comment