PTIME  Prime Time
For your math homework this week your teacher gave you five large numbers and asked you to find their prime factors. However these numbers aren't nearly large enough for someone with knowledge of programming like yourself. So you decide to take the factorial of each of these numbers. Recall that N! (N factorial) is the product of the integers from 1 through N (inclusive). It’s your job now to create a program to help you do your homework.
Input
Each test case contains a number N (2 ≤ N ≤ 10000).
Output
The output should contain a line representing the prime factorization of the factorial given number, which should be of the form: p_{1}^e_{1} * p_{2}^e_{2} * ... * p_{k}^e_{k} where p_{1}, p_{2}, ..., p_{k} are the distinct prime factors of the factorial of the given number in increasing order, and e_{1}, e_{2}, ..., e_{k} are their exponents.
Example
Input: 10 Output: 2^8 * 3^4 * 5^2 * 7^1
hide comments
Ouditchya Sinha:
20130512 08:33:27
Easy problem :) 

:):
20130421 08:20:08
nice problem :) 

Venkatesh Ganesan:
20130202 06:36:13
Can you please tell me why my submission (ID 8638869) is WA ? 

Adam D:
20130125 15:22:24
Last edit: 20130903 14:05:47 

Philipp Heeg:
20121230 21:12:22
Last edit: 20121230 21:12:48 

Mitch Schwartz:
20121024 23:20:47
Yes, each input file only contains one number. Jared's comment implied otherwise, and I hadn't bothered submitting before because to me it's not a very interesting problem. The problem statement is still unclear, but anyway it's not necessary to read until EOF. 

nikoo28:
20121022 18:13:51
FOR EVERYONE WHO IS GETTING A WA...the value of N>(10^4) for some test cases...i was also a victim and it did cost me 6 WA's.. :@ Last edit: 20121022 18:17:18 

S__L:
20121022 15:37:42
Hi! Please check my solution. I just can't figure out why it gives a wrong answer!


nikoo28:
20121020 17:04:21
sir please check my submission id..#7896221

Added by:  Amlesh Jayakumar 
Date:  20120619 
Time limit:  1s 
Source limit:  50000B 
Memory limit:  1536MB 
Cluster:  Cube (Intel G860) 
Languages:  All except: ASM64 
Resource:  DWITE Programming Contest 2012 (Own Problem) 