Source: https://ressources.unisciel.fr/algoprog/s14loops/emodules/lp06mexerc1/res/lp06exerc1-cresolu-cpp-xxx.pdf