solved 2009-round c problem