Source: https://www.amd.e-technik.uni-rostock.de/ma/rs/lv/smpi/exercises.pdf