Divisors in order

Write a program to print in order all the divisors of a given number.

Input

Input consists of several cases, each with a natural number nn between 1 and 10910^9.

Output

For every nn, print the divisors of nn in increasing order.

Observations

Hint

Every divisor smaller than the square root of nn has a corresponding divisor greater than the square root of nn. It could be useful to make two loops, one for “small” divisors, and another for “large” divisors.

Problem information

Author: Unknown
Translator: Salvador Roura

Generation: 2026-01-25T10:40:15.214Z

© Jutge.org, 2006–2026.
https://jutge.org