The twenty-one casks P31618


Statement
 

pdf   zip

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 nn, all between 2 and 10610^6.

Output

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

Public test cases
  • Input

    7
    7
    9
    

    Output

    7:
    3 1 3
    2 3 2
    2 3 2
    7:
    3 1 3
    3 1 3
    1 5 1
    9:
    3 3 3
    3 3 3
    3 3 3
    
  • Information
    Author
    Salvador Roura
    Language
    English
    Translator
    Salvador Roura
    Original language
    Spanish
    Other languages
    Spanish
    Official solutions
    C++
    User solutions
    C++