FACTCG2  Medium 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^7) .
Output
For each line you need to output the factorization separated by “ x ” and including 1.
Sample
Input 1 2 4 8 Output 1 1 x 2 1 x 2 x 2 1 x 2 x 2 x 2
hide comments
singh_811:
20170921 18:56:11
@admin Need help because I am not able to submit the solution. 

saurav52:
20170702 23:38:15
use sieve... 

sandeep_4141:
20170609 12:27:34
very poor logic :)....use scanf && printf instead of cin && cout !! 

aditya_rev:
20170516 02:28:12
dont know why im getting wa, can someone tell me one case? 

anurag_tangri:
20170403 19:01:34
learnt a lot ! unlimited TLES and then AC!


Praveen Kulkarni:
20170319 04:36:58
I am getting runtime error (NZEC)....can any one please help how to deal with taking input in interpreted languages such as perl? When to stop taking input? 

shahzada:
20170301 15:17:42
so many optimizations. 

aditya930:
20170202 22:17:10
nice problem....use sieve....!!!! 

sandeepg97:
20161210 12:27:34
@yash Sharma...you made my day!!!


sushantoberoi3:
20160825 18:16:54
use printf/scanf...cin/cout> tle

Added by:  Phyllipe Medeiros 
Date:  20120226 
Time limit:  0.517s 
Source limit:  50000B 
Memory limit:  1536MB 
Cluster:  Cube (Intel G860) 
Languages:  All except: ASM64 