FACTCG - Easy Factorization

no tags 


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: 2018-02-25 19:19:18

what the heck !! u idiot
why can't u change " x"to " x ".. costed me 3 WA

darkhire21: 2016-01-15 15:27:05

@Phyllipe medeiros please correct output statement " x" to " x " .

darkhire21: 2016-01-15 15:25:42

sieve works fine 0.22 seconds .

Rishabh: 2015-02-01 12:47:58

Just see ur spaces.cost me 2 WA

Somil Gupta: 2015-01-13 10:10:48

Thanks for the strict time limit... found a new technique altogether :)

jaans: 2012-06-21 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: 2012-04-20 03:44:45

can you please tell me where my algorithm fails ?
ID 6876204

[Retired] Fendy Kosnatha: 2012-02-27 01:54:20

yeah, i using sherman lehman algorithm in this problem..

Phyllipe Medeiros: 2012-02-27 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: 2012-02-27 01:47:53
[Retired] Fendy Kosnatha: 2012-02-27 01:35:13

my solution in FACT0 and FACT1 is AC, but why in this problem is TLE? :|


Added by:Phyllipe Medeiros
Date:2012-02-26
Time limit:0.654s
Source limit:50000B
Memory limit:1536MB
Cluster: Cube (Intel G860)
Languages:All except: ASM64