This task can be simplified to be factorized with Fermat's Factorization Method, as shown in full write-up [here](https://github.com/epicleet/write-ups/tree/master/2022/zer0ptsCTF/crypto/anti_fermat).