Rating:

There is a random fault on the calculation of $d_q$, so use it to obtain $p$.

Original writeup (https://www.nevivur.net/writeups/2019/04/tjctf-2019/#cats-ruin-things).