b = number of bulls bought c = number of cows bought g = number of batches of 20 goats bought
So you need to spend your $100? => c + 5b + g = 100 You need to have 100 animals? => c + b + 20g = 100 You need at least 1 of each animal? => c > 0, b > 0, g > 0 Looks like a simplex problem to me? Paul Smith p...@pollyandpaul.co.uk On Fri, Aug 10, 2012 at 7:44 AM, Bonethug <tejeshwa...@gmail.com> 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 google-code@googlegroups.com. > To unsubscribe from this group, send email to > google-code+unsubscr...@googlegroups.com. > 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 google-code@googlegroups.com. To unsubscribe from this group, send email to google-code+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.