Useful algorithms for programming competitions.