Source: https://www.lamsade.dauphine.fr/~mayag/tp1_2011-12.pdf