Fermat's Last Theorem + 3SUM algorithm