Source: https://www.lamsade.dauphine.fr/~mayag/Enonce TP1.pdf