Source: https://perso.univ-rennes1.fr/matthieu.romagny/LG308/corrige_f_LG308.pdf