Qm

Which barrel holds the beer?

A merchant has six barrels holding 15, 16, 18, 19, 20 and 31 gallons. Five contain wine and one contains beer. He sells the wine, in whole barrels, to two customers: the first buys some barrels and the second buys exactly twice as many gallons as the first. All five wine barrels are sold.

Which barrel contains the beer, and who bought what?

Show a hint

The wine sold totals three times what the first customer bought, so the wine total must be divisible by 3. Use remainders modulo 3.

Your answer

Solving needs a free account

Answers, streaks and solutions unlock when you are signed in. Reading the question and the hint stays free.

Discussion

Sign in to join the discussion · reading is open to everyone

💡 Discussion rules

  1. No full solutions here. Hints and approaches only.
  2. Complexity, edge cases and intuition are the point.
  3. Interview experiences are welcome. Respect your NDAs.

Loading discussion…

Learn the concepts

The theory behind this question.

Related questions

The bookworm and the ten volumesA hundred animals for a hundred poundsThe spider and the flyTen prisoners and hats of ten colorsThe 100 lockers problem
All questions →