Problems from Waterloo/Alberta Programming Contest 2004-06-12