VM7WC '16 #1 Bronze - A New Prime Factorization

View as PDF

Submit solution

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

Author:
Problem type
Allowed languages
Ada, Assembly, Awk, Brain****, C, C#, C++, COBOL, CommonLisp, D, Dart, F#, Forth, Fortran, Go, Groovy, Haskell, Intercal, Java, JS, Kotlin, Lisp, Lua, Nim, ObjC, OCaml, Octave, Pascal, Perl, PHP, Pike, Prolog, Python, Racket, Ruby, Rust, Scala, Scheme, Sed, Swift, TCL, Text, Turing, VB, Zig

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 the 2016, and, to save yourself time in the future, any other year.

Input Specification

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

Output Specification

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

Sample Input

2015

Sample Output

5
13
31

Comments


  • 0
    JeffreyZ  commented on Jan. 7, 2016, 3:36 p.m.

    If Y = 32, print the following:

    2
    2
    2
    2
    2