FACTCG  Easy Factorization
The task in this problem is to write a number in a multiplication of prime numbers separated by “ x”. You need to put the
number 1 in this multiplication.
Input
The input consists of several lines.
Each line consists of one integer N (1 <= N <= 10^5) .
Output
For each line you need to output the factorization separated by “ x” and including 1.
Sample Input
1
2
4
8
Sample Output
1
1 x 2
1 x 2 x 2
1 x 2 x 2 x 2
hide comments
ab_biswas09:
20180225 19:19:18
what the heck !! u idiot


darkhire21:
20160115 15:27:05
@Phyllipe medeiros please correct output statement " x" to " x " . 

darkhire21:
20160115 15:25:42
sieve works fine 0.22 seconds . 

Rishabh:
20150201 12:47:58
Just see ur spaces.cost me 2 WA 

Somil Gupta:
20150113 10:10:48
Thanks for the strict time limit... found a new technique altogether :) 

jaans:
20120621 16:45:25
@Phyllipe > the tutorial version helped me a lot to bring down my time limit :)) thanks for the tutorial version :)great work !!! 

Ahmed AKram:
20120420 03:44:45
can you please tell me where my algorithm fails ?


[Retired] Fendy Kosnatha:
20120227 01:54:20
yeah, i using sherman lehman algorithm in this problem.. 

Phyllipe Medeiros:
20120227 01:43:54
Thanks Mitch! I was thinking in move this to tutorial too, thank you for your opinion! Fendy there are a lot of queries, but a simple sqrt solution is enough. Maybe you should try to not use cin/cout. Last edit: 20120227 01:47:53 

[Retired] Fendy Kosnatha:
20120227 01:35:13
my solution in FACT0 and FACT1 is AC, but why in this problem is TLE? : 
Added by:  Phyllipe Medeiros 
Date:  20120226 
Time limit:  0.654s 
Source limit:  50000B 
Memory limit:  1536MB 
Cluster:  Cube (Intel G860) 
Languages:  All except: ASM64 