#P4930. [PA 2013] Euler

[PA 2013] Euler

Problem Description

Given nn, find all xx such that φ(x)=n\varphi(x) = n.

Input Format

The first line contains an integer TT.

The next TT lines each contain an integer nn.

Output Format

Output a total of 2×T2 \times T lines.

For each test case, output an integer mm indicating the number of valid values.

Then output a second line containing mm integers xix_i in increasing order. If mm is 00, output an empty line.

4
8
10
13
6
5
15 16 20 24 30
2
11 22
0

4
7 9 14 18

Hint

For 100%100\% of the testdata, 1T51 \le T \le 5, 1n10101 \le n \le 10^{10}.

Translated by ChatGPT 5