ZOJ Problem Set - 2779
Every positive integer N can be written in at least one way as a sum of terms of the form (2a)(3b) where no term in the sum exactly divides any other term in the sum. For example:
1 = (20)(30)
Note from the example of 31 that the representation is not unique.
Write a program which takes as input a positive integer N and outputs a representation of N as a sum of terms of the form (2a)(3b).
The first line of input contains a single integer C, (1 <= C <= 1000) which is the number of datasets that follow.
Each dataset consists of a single line of input containing a single integer N, (1 <= N < 231), which is the number to be represented as a sum of terms of the form (2a)(3b).
For each dataset, the output will be a single line consisting of: The dataset number, a single space, the number of terms in your sum as a decimal integer followed by a single space followed by representations of the terms in the form [<2 exponent>,<3 exponent>] with terms separated by a single space. <2 exponent> is the power of 2 in the term and <3 exponent> is the power of 3 in the term.
1 1 [0,0]
Source: Greater New York Regional 2006