British Informatics Olympiad 2009 Question 1