Source: https://www.imo.universite-paris-saclay.fr/~pallier/pdfs/S1TD1.pdf