VM7WC '16 #1 Bronze - A New Prime Factorization

View as PDF

Submit solution

Points: 5
Time limit: 1.0s
Memory limit: 62M

Author:
Problem type

Leo was really bored after finishing all of Project Euler, so he decided to create his own computational mathematics website: Project Feng! Here, he'll be able to enlighten the students of Massey with new computer science problems. For his first problem, Leo decides on something simple, but crucial:

The year has changed from 2015 to 2016. Since the current year is often used in math contest problems, it's very helpful to know its prime factorization. Leo is a very diligent math student and already knows the prime factorization of 2015. Use his information to write a program to find the prime factorization of 2016, and, to save yourself time in the future, any other year.

Input Specification

One line containing the integer Y (1 \le Y \le 10^9), the year to prime factorize.

Output Specification

On every line and in increasing order, print a prime factor of Y.

Sample Input

2015

Sample Output

5
13
31

Comments


  • 1
    icerv1  commented on Nov. 30, 2022, 12:41 a.m.

    If there is no possible factorisation, you output nothing.


  • 1
    JeffreyZ  commented on Jan. 7, 2016, 8:36 p.m.

    If Y = 32, print the following:

    2
    2
    2
    2
    2