Divisors of n

Given a number n your task is to find out all the divisors of n.
The input consists of a single number n (1 ≤ n ≤ 1000).
The program should print all the divisors of n each on a separate line.
Input
Output
7
1 7
16
1 2 4 8 16
 

Constraints

Time limit: 2 seconds

Memory limit: 512 MB

Output limit: 1 MB

To check your solution you need to sign in
Sign in to continue