Algorithms for programming contests and ACM-ICPC.