Hide

Problem E
Factoring

Input

Standard input consists of several lines, each containing a number $N>1$. No number in the input will have more than $100$ bits.

Output

For each input number $N$, you should produce either the correct factorization of $N$, or the message “fail”, indicating that you failed to factor $N$.

The factorization of $N$ should be given by printing all prime factors (with repetitions) of $N$, each on a line of its own. Any ordering of the factors is acceptable.

You must output a blank line between the output for different test cases.

Score

The score for your submission is $100 \cdot A/B$ rounded to the nearest integer, where $B$ is the total number of numbers in the input, and $A$ is the number of these that were successfully factored.

Sample Input 1 Sample Output 1
20
175891579187581657617
4294967291
2
2
5

fail

4294967291

Please log in to submit a solution to this problem

Log in