Source: http://richard-ostrowski.eu/SILNTI/ressources/exercicesMerise.pdf