Source: https://www.maths-france.fr/MathSpe/Problemes/Mines/2012/MinesPonts_2012_MP_M1_Corrige.pdf