Sphere Online Judge

Because of maintenance, it is currently impossible to submit any solutions. The maintenance will end around 3:00 am GMT (4:00 am SPOJ time).

This message will disappear once the maintenance is finished.

SPOJ Problem Set (classical)

10818. Medium Factorization

Problem code: FACTCG2

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.


The input consists of several lines.

Each line consists of one integer N (1 <= N <= 10^7) .


For each line you need to output the factorization separated by “ x” and including 1.

Sample Input





Sample Output

1 x 2
1 x 2 x 2
1 x 2 x 2 x 2

Added by:Phyllipe Medeiros
Time limit:6s
Source limit:50000B
Memory limit:256MB
Cluster: Pyramid (Intel Pentium III 733 MHz)

hide comments
2014-11-03 04:26:18 avinish chandra
12799109-cannot understand why i am getting wrong answer.plz help
2014-10-20 19:38:59 Insane mode
It would be helpful if someone told me countercase for WA.

Last edit: 2014-10-20 20:49:46
2014-10-05 06:19:27 Rahul Ranjan
getting WA on 4th test case....Suggest some test cases..I m using sieve...link----> http://ideone.com/nUC7sH

Last edit: 2014-10-05 07:23:30
2014-09-18 00:05:18 Baojun Wang
same algorithm, C++ passed, Haskell version TLE, even haskell version is almost the same on my machine. Time to upgrade haskell compiler on SPOJ?

Last edit: 2014-09-18 00:24:41
2014-08-21 10:00:32 pushkar
can anyone suggest some input.. My program is failing for judge 4.
2014-08-09 14:04:53 Harry Mathis
Same algorithmn is getting TLE in Java but AC in C++
2014-06-07 11:20:35 Linghui Liu
21.33s is AC!!
2014-05-08 17:33:16 is_jas

Last edit: 2014-09-13 21:03:20
2014-03-29 18:10:28 ||N0VICE||
Nice prob
was getting WA because of printing an extra 1 at the end of stdin
2014-03-07 23:55:21 Ramesh Kumar Katreddi
Input Specification needs to be proper. the x is small and needs one space on either side. and in the example it actually looks like capital X. Lot of TLE's. but finally ac :)
© Spoj.com. All Rights Reserved. Spoj uses Sphere Engine™ © by Sphere Research Labs.