PHƯỚC HƯNG OJ · THỬ THÁCH THUẬT TOÁN
#GL0000169. Tiệc Iftar (Iftar Party)
HỌC THEO LỘ TRÌNH
1 lộ trìnhBài tập thuộc lộ trình
Mục lục đề ⌄
Đang đọc
Tiệc Iftar (Iftar Party)
Ifter Party
Source: LightOJ
Version: Phuoc Hung OJ Extended
Problem Statement
An Iftar gathering starts with snacks for participants. Each participant consumes exactly snacks, and snacks remain. The number eaten by each participant is strictly larger than the remaining number: . Both and are positive integers. Find all possible values of in increasing order, or print impossible if none exists.
Input
One line contains two integers .
Output
Print all valid values in increasing order on one line separated by spaces; print impossible if there is no valid value.
Subtasks
- Subtask 1 (20 points): .
- Subtask 2 (30 points): .
- Subtask 3 (50 points): .
Examples
Input
300 98
Output
101 202
Explanation
The total number consumed is , so . The positive divisors are , and only are greater than , corresponding to or .