#P4397. [JLOI2014] 聪明的燕姿
[JLOI2014] 聪明的燕姿
Description
In the city, people always hold number tickets, keep searching, and keep matching, yet no one knows whom they are waiting for.
But Yanzi is different. Yanzi knows whom she is waiting for, because she is good at math. Yanzi discovered a magical algorithm: suppose the number on her ticket is , then the sum of all positive divisors of the number on the other person's ticket must equal .
So Yanzi always searches through subways and crowds holding her number ticket to find numbers (Hey! Is this really reliable?), but she is busy singing "Green Light" and wants to ask you to write a program to quickly find everyone she is waiting for.
Input Format
The input contains test cases.
For each test case, the input consists of a single integer .
Output Format
For each test case, output two lines. The first line contains an integer , denoting there are people she is waiting for.
The second line contains the corresponding numbers, which are the number tickets of all those people.
In particular, when , i.e., no number satisfies the requirement, that test case should not output the second line (only output the single line ).
Note: The numbers you output must be in ascending order.
42
3
20 26 41
Hint
For of the testdata, , .
Translated by ChatGPT 5
京公网安备 11011102002149号