After the disaster hack by the machine, the new YoRHa project decides to employ a new security system. This system is among the most sophisticated ever devised, employing advanced cryptographic algorithms to ensure that vital information remains secure. At the heart of this security lies a unique hashing mechanism, where each piece of data is represented by the mathematical operation $$$x^y \pmod{p}$$$, where $$$p$$$ is a prime number. This system transforms every input into a signature, a seemingly random sequence that only the YoRHa servers can decode.
However, as the war with the machine lifeforms drags on, concerns arise among the operators. What if multiple pieces of information, when processed by this hashing algorithm, result in the same signature? This could lead to a catastrophic failure in the security system, where critical data is overwritten or lost due to collisions in the hash function. To prevent this, operator 21O is tasked with an important mission: to compute how many different inputs could possibly hash into the same signature for every possible output.
For every $$$k=1,2,3,\dots,p-1$$$, the operator must analyze how many pairs of integers $$$1 \leq a,b \leq p-1$$$ satisfies $$$a^b \equiv k \pmod{p}$$$. By determining how many different combinations result in the same hash, they can assess the risk of collisions and adjust the security protocols accordingly. This analysis becomes a race against time, as the integrity of YoRHa's communication and data storage hinges on the successful execution of this mission. The fate of the war may very well depend on the operator's ability to ensure that the security system remains unbreakable.
A single number $$$p$$$ such that $$$2 \leq p \lt 100,000$$$. It's guaranteed that $$$p$$$ is a prime number.
A single line of $$$p-1$$$ numbers. The $$$k^{th}$$$ number is the number of pairs $$$(x,y)$$$ such that $$$x^y \equiv k \pmod{p}$$$.
3
3 1
13
40 4 16 8 10 4 4 10 16 8 4 20
2
1
Description for sample 1: There are 3 pairs that result in $$$x^y \equiv 1 \pmod{3}$$$: $$$(1,1)$$$, $$$(1,2)$$$, and $$$(2,2)$$$. There is 1 pair that results in $$$x^y \equiv 2 \pmod{3}$$$: $$$(2,1)$$$.
| Name |
|---|


