Source: http://ressources.unit.eu/cours/EnsROtice/04ExercicesFileAttente_01/co/Q1-1.html.pdf