Oh no!
is taking ICS this semester and once again, he has left his homework to the last minute. Luckily, it only consisted of one question:Given a list of natural numbers, output the prime factorization of each number.
Unfortunately, he was too busy typing up this problem statement to do it.
Would you write a program that does his homework for him? As compensation, he will gladly reward you with five points.
Input Specification
The input begins with an integer
The next
Output Specification
For each integer
Sample Input
Copy
5
3
13
42
666
1369
Sample Output
Copy
3
13
2 3 7
2 3 3 37
37 37
Comments
Tips to avoid TLE in java?
Edit: Figured it out
BigInteger is slow. Don't use it, as it's not required for this problem.
You don't even need longs to solve it.