#P4397. Divisor Sum Matching
Divisor Sum Matching
Divisor Sum Matching
In the city, everyone holds a numbered card and wanders the crowds trying to find a match – yet no one knows who they are really waiting for. However, Yanzi is different. Thanks to her knack for mathematics, she discovered a magical algorithm: if her card displays the number \( S \), then the card of the person she is waiting for must have a number whose sum of all positive divisors is exactly \( S \).
Your task is to help Yanzi: given an integer \( S \), find all positive integers \( x \) (if any) such that \( \sigma(x)=S \), where \( \sigma(x) \) denotes the sum of all positive divisors of \( x \) (including 1 and \( x \) itself). If no such numbers exist, output -1.
inputFormat
A single integer ( S ) (1 ≤ S ≤ 100000), representing the number on Yanzi's card.
outputFormat
Output all positive integers ( x ) in increasing order separated by a space for which the sum of their positive divisors equals ( S ). If no such number exists, output -1.
sample
1
1