Source: https://www.lrde.epita.fr/people/akim/thl/exams/epita-2010-thl-correction.pdf