PHƯỚC HƯNG OJ · THỬ THÁCH THUẬT TOÁN
#GL0000163. Chia bánh su kem (Cream puff)
HỌC THEO LỘ TRÌNH
1 lộ trìnhBài tập thuộc lộ trình
Mục lục đề ⌄
Đang đọc
Chia bánh su kem (Cream puff)
Cream puff
Source: AtCoder
Version: Phuoc Hung OJ Extended
Problem Statement
There are identical cream puffs. You want to distribute all of them among a positive number of people so that every person receives the same number of whole puffs, with no cutting and no leftovers. Print every possible number of people in increasing order.
Input
One line containing the positive integer .
Output
Print each valid number of people on a separate line in increasing order.
Subtasks
- Subtask 1 (20 points): .
- Subtask 2 (30 points): .
- Subtask 3 (50 points): .
Examples
Input
12
Output
1
2
3
4
6
12
Explanation
For people, each receives respectively whole puffs. Any other positive number of people would leave a remainder.