Python:
print [(c,b,g) for c in xrange (101) for b in xrange(101) for g in
xrange(0,101,20) if c+b+g == 100 and c+5*b+(g/20) == 100]
On Aug 10, 2012 8:01 AM, "Bonethug" <[email protected]> wrote:

> You have $100. You need to buy cows, bulls and goats which sell at the
> following rate.
> $1 = 1 Cow
> $5 = 1 Bull
> $1 = 20 Goats
> How will you purchase these animals so that you spend your $100 and you
> have 100 animals which includes the cows, bulls and goats.
> A pretty tough question for more google code community, I need help,
> Thanks and Regards,
> Bonethug
>
> --
> You received this message because you are subscribed to the Google Groups
> "Google Code Jam" group.
> To post to this group, send email to [email protected].
> To unsubscribe from this group, send email to
> [email protected].
> To view this discussion on the web visit
> https://groups.google.com/d/msg/google-code/-/Gg_LTqD8YdEJ.
> For more options, visit https://groups.google.com/groups/opt_out.
>
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Google Code Jam" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to