#C13940. Calculate All Factors

    ID: 43534 Type: Default 1000ms 256MiB

Calculate All Factors

Calculate All Factors

Given an integer ( n ), write a program to compute all factors of ( |n| ) (i.e. the absolute value of ( n )) in ascending order. Note that if ( n = 0 ), the program should output just "0". A factor is an integer ( i ) such that ( n \bmod i = 0 ). For example, when ( n = 12 ), the output should be: 1 2 3 4 6 12. The input is read from standard input and the result must be printed to standard output.

inputFormat

The input consists of a single integer ( n ) provided via standard input.

outputFormat

Print all factors of ( |n| ) in ascending order, separated by a space. If ( n = 0 ), output only ( 0 ).## sample

0
0