Source: https://daillya.github.io/Cours/ComplexityMex/exam-TMandMore-corr.pdf