Solutions for some programming problems from book "Programming Challenges: The Programming Contest Training Manual"