1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27
|
from random import randint
def make_bricks(small, big, goal): if 5*big <= goal: s = goal-5*big if s<=small: return True else: s = goal%5 return s<=small return False
def main(): for _ in range(10): small = randint(0,9) big = randint(0,9) goal = randint(0,9) print 'small:{0}, big:{1},goal: {2}=> {3} '.format(small,big,goal,make_bricks(small,big,goal)) if __name__ == "__main__": main()
|