News for hackers. Stuff that matters.
Re:“The following surprisingly difficult problem was given t... by _paulc on Tuesday October 21, 2014 @07:37AM (#8486840)
Except that I get a different answer if you do a very simple bruteforce:

    def check(n,am,pm,total):
        for x in range(1,n):
            if (am * x + pm * (n-x)) == total:
                return "AM: %d @ %d / PM %d @ %d" % (x,am,n-x,pm)
        return None


    def solve(total,birds):
        for am in range(1,total):
            for pm in range(1,am):
                result = list(map(lambda n:check(n,am,pm,total),birds))
                if all(result):
                    return result

    print(solve(3500,[10,16,26]))

There are no comments on this comment yet.