Sphere Online Judge

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-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 :)
2014-02-06 15:12:20 Himanshu Sahu
AC after 21 TLE,RE,CE 15.?? sec..
2014-01-09 17:29:29 Mukund Kumar
Learnt something new :)
2013-12-30 07:12:29 .::Lakshman::.
@tend The time limit was never 22 second. The input file have multiple test cases , and the running time u are talking about us sum of running time of all test files.
click on all submission and check my today submission and it took 17s

Last edit: 2013-12-30 07:18:49
2013-12-30 06:34:49 tend
@Lakshman there is time limit of 6s but many solutions have been accepted previously in even 22s.
2013-12-29 16:32:48 .::Lakshman::.
@tend which previous time limit you are talking about.
2013-12-29 15:44:04 tend
why time limit has been reduced from previous one !!
2013-12-19 16:44:48 Man Mohan Mishra
nice problem...
tried something new in it.. :)
2013-10-18 16:04:05 Anand Kr Shaw
i printed all the testcases and checked upto 10^7,....did not find any mistake...getting wa ...help ???
© Spoj.com. All Rights Reserved. Spoj uses Sphere Engine™ © by Sphere Research Labs.