Solves squarefree Pell, then full Pell via exponentiation by squaring.