medium   Brainteasers

Beer Barrel II

A release-checked medium problem for training Brainteasers.

Question

A 120-quart beer barrel was discovered by Anna's parents. Furious, they plan to dump the barrel. Anna begs her parents to let her keep some of the beer. They say that Anna may do so if she is able to measure out an exact quart into each of a 7-quart and 5-quart vessel. You have exactly $1$ of each type of vessel. Note that Anna is allowed to pour beer from a vessel back into the beer barrel. Define a transaction as a pour of liquid from one container into another. What is the smallest number of transactions needed to accomplish the challenge? If impossible, respond with -1.

Practice focus

This Brainteasers problem is tagged Brainteasers. State the random variables and conditioning information explicitly, then check the result against boundary cases before opening hints or a solution.

Explore related collections

Reviewed questions in this area

easy9 AppearanceReviewed

Brainteasers · Marshall Wace, Akuna