British Informatics Olympiad 2010 Question 1