Source: https://babel.csfoy.ca/profs/maverreault/NYA/Exercices Sol/Ch07_Exercices Solutions.pdf