#K37872. Factor Combinations
Factor Combinations
Factor Combinations
Given an integer n
, find all possible combinations of its factors, where each factor must be greater than 1 and less than n. A combination is valid if the product of its factors equals n
. Formally, you need to find all sequences \( [a_1, a_2, \dots, a_k] \) such that for each \( i \), \( a_i > 1 \) and \( a_i < n \) and \( a_1 \times a_2 \times \dots \times a_k = n \).
Note that the factors in each combination should be in increasing order, and the overall list of combinations should follow the same order as shown in the examples.
inputFormat
The input consists of a single integer n
read from standard input.
outputFormat
Output all valid factor combinations of n
as a list of lists in the exact format as Python's list representation. Each inner list represents one valid combination. If no valid combination exists, output an empty list []
.
6
[[2, 3]]