ISSN 1822-7732 INTERNATIONAL OLYMPIAD IN INFORMATICS INSTITUTE OF MATHEMATICS AND INFORMATICS INTERNATIONAL FEDERATION FOR INFORMATION PROCESSING OLYMPIADS IN INFORMATICS Volume 3 2009 Selected papers of the International Conference joint with the XXI International Olympiad in Informatics Plovdiv, Bulgaria, August 8–15, 2009 OLYMPIADS IN INFORMATICS ISSN 1822-7732 Editor-in-Chief Valentina Dagiene˙ Institute of Mathematics and Informatics, Lithuania,
[email protected] Executive Editor Richard Forster British Informatics Olympiad, UK,
[email protected] International Editorial Board Gerald Futschek, Vienna University of Technology, Austria,
[email protected] Bruria Haberman, Holon Institute of Technology, Israel,
[email protected] Marcin Kubica, Warsaw University, Poland,
[email protected] Ville Leppänen, University of Turku, Finland,
[email protected].fi Krassimir Manev, Sofia University, Bulgaria,
[email protected]fia.bg Fredrik Niemelä, KTH University, Sweden,
[email protected] Rein Prank, University of Tartu, Estonia,
[email protected] Miguel A. Revila Ramos, University of Valladolid, Spain,
[email protected] Peter Taylor, University of Canberra, Australia,
[email protected] Troy Vasiga, University of Waterloo, Canada,
[email protected] Peter Waker, International Qualification Alliance, Republic of South Africa,
[email protected] http://www.mii.lt/olympiads_in_informatics c Institute of Mathematics and Informatics, 2009 Olympiads in Informatics, Volume 3, 2009 2009.06.30. 13 leidyb. apsk. l. Tirazˇas 200 egz. Uzˇsakymas Nr. 1748 Printed by Printing house “Mokslo aidai”, Gosˇtauto 12, 01108 Vilnius, Lithuania Olympiads in Informatics, 2009, Vol. 3 2009 Institute of Mathematics and Informatics, Vilnius Foreword OLYMPIADS IN INFORMATICS is an annual refereed journal that provides an inter- national forum for presenting research in teaching and learning informatics through competition.