OPCPRIME - Prime Factorization

no tags 

Given a number n (n <= 10^12) print all its prime factors in strictly ascending order. (Note each prime factor should be printed on a new line.)

Warning: Use long long int for taking input. Integer will overflow. The format specifier for long long int is %lld.

Example

Input:
60

Output:
2
3
5
Input:
100

Output:
2
5

hide comments
Devashish: 2014-07-13 13:17:53

till when to take the input? ...no. of test cases or feof?

EDIT: take it till EOF...

Last edit: 2014-07-13 18:17:39

Added by:bashrc is back
Date:2012-08-10
Time limit:0.100s-1s
Source limit:50000B
Memory limit:1536MB
Cluster: Cube (Intel G860)
Languages:All except: ASM64