Baltic Olympiad in Informatics: 2004 Day 1, Problem 2
You are given an equal arm scale, a set of weight pieces, and an object. The pieces are of weight
Constraints
Input Specification
The first line of the input contains one integer
Output Specification
Your output should consist of two lines.
The first line should contain information about pieces put on the left scale pan. The first number must be a non-negative integer - the number of pieces put on the left scale pan followed by weights of pieces in increasing order. Numbers must be separated by single spaces.
The second line must contain information about pieces put on the right scale pan with the same format as the first line.
Sample Input 1
42
Sample Output 1
3 3 9 27
1 81
Sample Input 2
30
Sample Output 2
0
2 3 27
Comments