P4930 [PA 2013] Euler

Description

Given $n$, find all $x$ such that $\varphi(x) = n$.

Input Format

The first line contains an integer $T$. The next $T$ lines each contain an integer $n$.

Output Format

Output a total of $2 \times T$ lines. For each test case, output an integer $m$ indicating the number of valid values. Then output a second line containing $m$ integers $x_i$ in increasing order. If $m$ is $0$, output an empty line.

Explanation/Hint

For $100\%$ of the testdata, $1 \le T \le 5$, $1 \le n \le 10^{10}$. Translated by ChatGPT 5