The twenty-one casks

A sheikh had to pay three men with a batch of 21 equal wine casks, seven
of them being full, seven half-full, and seven empty. How could Beremiz
do the distribution, in such a way that each man received the same
number of casks and the same amount of wine?

Input

Input consists in several natural numbers n, all between 2 and 10⁶.

Output

For every n, print a line with “n:”. Then, print in three lines any way
to divide n full casks, n half-full casks and n empty casks among three
men, so that each one receives n casks and the same total amount of
wine. The i-th line must contain, separated by spaces, the number of
full casks, half-full casks and empty casks that correspond to the i-th
man. Follow the format of the samples exactly.

Problem information

Author: Unknown
Translator: Salvador Roura

Generation: 2026-01-25T10:12:37.708Z

© Jutge.org, 2006–2026.
https://jutge.org
