Submit | All submissions | Best solutions | Back to list |
TRIALDIV - Trial Division |
In this problem, your task is to compute the decomposition of an integer into prime factors.
Input
The first line of the input contains an integer T denoting the number of test cases. The description of Ttest cases follows. Each test case is described in a single line containing a single integer « n » (1 ≤ n ≤ 106).
Output
For each test case, print in a single line the decomposition of an integer into prime factors as a list of increasing space-separated integers.
Example
Input: 6 16 127 256 513 2048 5097 Output: 2 2 2 2 127 2 2 2 2 2 2 2 2 3 3 3 19 2 2 2 2 2 2 2 2 2 2 2 3 1699
Added by: | mbk_live |
Date: | 2019-01-08 |
Time limit: | 1s |
Source limit: | 50000B |
Memory limit: | 1536MB |
Cluster: | Cube (Intel G860) |
Languages: | C-CLANG C C++ 4.3.2 CPP CPP14 CPP14-CLANG C99 JAVA PYTHON PYTHON3 SWIFT |